This is an optimization.
For immutable objects, it's superfluous to create an actual copy, so - copy
is often implemented as a simple retain, i. e.
- (id)copy
{
[self retain];
return self;
}
Try assigning a mutable object (e. g. NSMutableString
) to the property, and you will get the "expected" behavior.