NSAttributedString crashes
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