(NSString *a == NSString *b)
sometimes will work by accident, if the string references are the same (ie: comparing string constants or only a few unique strings are passed around)
But it's by no means safe or ever should be used. Try it for yourself:
NSString *foo = [NSString stringWithFormat:@"foo"];
NSString *bar = [NSString stringWithString:@"foo"];
NSLog(foo == bar ? @"references are equal" : @"references are NOT equal");
NSLog([foo isEqualToString:bar] ? @"strings are equal" : @"strings are NOT equal");
But with constant strings it will work (purely by luck, since the compiler consolidated the constants together)
NSString *foo = @"foo";
NSString *bar = @"foo";
NSLog(foo == bar ? @"references are equal" : @"references are NOT equal");
Point being, never compare strings by pointer equality.