On Mar 3, 2011, at 7:32 PM, Graham Cox wrote:

> On 04/03/2011, at 11:54 AM, Matt Neuburg wrote:
> 
>> because NSString is a very, very special case. Memory management for strings 
>> is utterly different from memory management for a normal object
> 
> 
> Is it?
> 
> Are you basing this on your observations, or on some documentation?

Well, I may have put it rather too strongly - string literals are special, is 
what I meant. But many strings start life as a literal. I'm not saying one 
should *treat* them differently - indeed, doing that is a good way to get into 
trouble. I'm just saying that if you peek at the man behind the curtain (the 
retain count) they can be surprising - like the retain count for 
stringWithString:@"hello". At one point I needed to make a string with a 
"normal" retain count (for a teaching example) and had quite a bit of trouble 
working out how to do it. m._______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to