Re: NSAttributedString crashes
Re: NSAttributedString crashes
- Subject: Re: NSAttributedString crashes
- From: Corbin Dunn <email@hidden>
- Date: Fri, 04 Mar 2011 12:18:20 -0800
On Mar 1, 2011, at 12:45 AM, Gerriet M. Denkmann wrote:
> 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?
No; you should log a bug requesting it to be documented. And/or, log a bug requesting the returned attributes be autoreleased.
corbin
_______________________________________________
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