• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAttributedString crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSAttributedString crashes
      • From: Matt Neuburg <email@hidden>
References: 
 >Re: NSAttributedString crashes (From: Matt Neuburg <email@hidden>)
 >Re: NSAttributedString crashes (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: NSAttributedString crashes
  • Next by Date: Re: NSAttributedString crashes
  • Previous by thread: Re: NSAttributedString crashes
  • Next by thread: Re: NSAttributedString crashes
  • Index(es):
    • Date
    • Thread