NSString is a little special when it comes to memory management. String literals (something like @"foo" ) are efficient singletones, each line with the same content is the same object, because it cannot be changed in any way. Since [NSString new] always creates an empty string that cannot be changed, you will always get the same instance that cannot be released (thus a high retainCount ).
Try this snippet:
NSString *string1 = [NSString new]; NSString *string2 = [NSString new]; NSLog(@"Memory address of string1: %p", string1); NSLog(@"Memory address of string2: %p", string2);
You will see that both lines have the same memory address and therefore the same object.
source share