Re: NSAttributedString crashes
Re: NSAttributedString crashes
- Subject: Re: NSAttributedString crashes
- From: Kyle Sluder <email@hidden>
- Date: Thu, 03 Mar 2011 16:35:22 -0800
On Thu, Mar 3, 2011 at 4:20 PM, Gerriet M. Denkmann
<email@hidden> wrote:
> But, taking my original example:
>
> NSAttributedString * attributedString = ...
> NSFont *aFont = [ attributedString attribute: NSFontAttributeName atIndex: 0 effectiveRange: NULL ];
> NSString *fontName = [aFont fontName];
> [ attributedString release ];
>
> Now aFont no longer exists.
> So fontName, being a property of the no longer existing aFont, should have vanished also, shouldn't it?
Replace "should" with "could." The point is that there's no guarantee,
and you need to be prepared for the case where it does.
--Kyle Sluder
_______________________________________________
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