retainCount doesn't return the reference count of an object. - it returns unrelated nonsense.
(For performance reasons, immutable constant strings, when copied, return self
. If you compare the pointer to @""
and [[NSString alloc] initWithString:@""]
, they will be equal.)