Re: NSAttributedString crashes
Re: NSAttributedString crashes
- Subject: Re: NSAttributedString crashes
- From: Matt Neuburg <email@hidden>
- Date: Thu, 03 Mar 2011 19:49:52 -0800
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 (email@hidden)
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:
This email sent to email@hidden