NSHipster/articles — pull request #27 by ericjohnson (2013-08-26 18:31:29+00:00)
Title: Update 2013-08-26-equality.md

This does not hold true for all immutable strings, only for those that are statically defined. Here is a simple counter example:

#import

int main(int argc, char * argv[]) {
@autoreleasepool {

NSString * a = @"Hello";
NSString * b = @"Hello";

NSMutableString * c = [[NSMutableString alloc] init];
[c appendString:@"Hel"];
[c appendString:@"lo"];

NSString * d = [[NSString alloc] initWithString:c];

NSLog(@"a == b: %d", a == b);
NSLog(@"a == d: %d", a == d);

}
}