I'm new to this - I'm trying to compare an NSString stringWithFormat with some text. It works great with stringWithString. I can not understand why it does not work with stringWithFormat? Thanks so much for any help anyone can offer!
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); }
David source share