Objective-C constants: NSString comparison using ==?
The discussions I found about setting NSString constants made me code it the following way: .h file: extern NSString * const kSectionHeaders; .m file: NSString * const kSectionHeaders = @"header"; As the program runs, it has to test words from a text file against a series of NSString constants. I read memory comparison should work when setting function like stated above: if (property == kSectionHeaders) {...} Doesn't work tough :( The following works, but it was described as a bad solution (slower, what else?): if ([property isEqualToString:kSectionHeaders]){...} I feel I've done something