【发布时间】:2011-08-13 17:57:26
【问题描述】:
我对此很陌生 - 我正在尝试将 NSString stringWithFormat 与一些文本进行比较。它适用于 stringWithString。我无法弄清楚为什么它不适用于 stringWithFormat? 非常感谢任何人都可以提供的任何帮助!
NSString *theQuestion = [NSString stringWithFormat:@"The same thing"];
if (theQuestion == @"The same thing"){
NSLog(@"stringWithFormat is the same as the given text");
}else{
NSLog(@"stringWithFormat is NOT the same as the given text");
NSLog(@"but theQuestion is:\"%@\"", theQuestion);
}
【问题讨论】:
标签: objective-c if-statement stringwithformat stringwithstring