Re: Dissappearing string
Re: Dissappearing string
- Subject: Re: Dissappearing string
- From: Uli Kusterer <email@hidden>
- Date: Wed, 16 May 2012 15:05:11 +0200
On 16.05.2012, at 15:02, Uli Kusterer wrote:
> - copy the string (which means the retain count stays 1, and the string gets deallocated when you release it)
Forgot to mention: When you *really* have an NSAttributedString (an immutable object), -copy can even be optimized out and be the same as a retain. OTOH if the string given is an NSMutableAttributedString, -copy actually creates an NSAttributedString from that (you'd have to call -mutableCopy to get an NSMutableAttributedString out instead). So there are a lot of factors, including who created the string and how, that influence the retain count going through the very same code.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________
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