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 protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to