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 (Cocoa-dev@lists.apple.com)

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

This email sent to arch...@mail-archive.com

Reply via email to