• 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
NSAttributedString crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAttributedString crashes


  • Subject: NSAttributedString crashes
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 01 Mar 2011 15:45:59 +0700

NSMutableAttributedString *attributedString = [ [ NSMutableAttributedString alloc ] initWithString: firstChar ];
[ attributedString fixFontAttributeInRange: NSMakeRange(0,[ attributedString length ]) ];
NSFont *aFont = [ attributedString attribute: NSFontAttributeName  atIndex: 0  effectiveRange: NULL ];
NSLog(@"%s font1 %@",__FUNCTION__, aFont);	//	ok
NSString *fontName = [aFont fontName];
[ attributedString release ];
NSLog(@"%s FontName %@",__FUNCTION__, fontName);	//	ok
NSLog(@"%s font2 %@",__FUNCTION__, aFont);	//	writes (null) or crashes

So obviously NSAttributedString does NOT return [ [ aFont retain ] autorelease ] but just some internal pointer.

Is this documented somewhere?

Kind regards,

Gerriet.

_______________________________________________

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: Corbin Dunn <email@hidden>
    • Re: NSAttributedString crashes
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Static Analyzer is confusing me
  • Next by Date: Re: How to find unencoded characters
  • Previous by thread: Re: Static Analyzer is confusing me
  • Next by thread: Re: NSAttributedString crashes
  • Index(es):
    • Date
    • Thread