Unrecognized selector -[UIFont fontName]?
Unrecognized selector -[UIFont fontName]?
- Subject: Unrecognized selector -[UIFont fontName]?
- From: Rick Mann <email@hidden>
- Date: Mon, 15 Jul 2013 17:58:55 -0700
Are a UIFont and CTFont the same thing? Seems like it, in that my UILabel's default font property contains a CTFont. But if I try to access the fontName, I get an exception.
For this code:
{
[self setFont: self.someUILabel.font];
}
- (void)
setFont: (UIFont*) inFont
{
if (inFont == nil)
{
[self.currentAttrs removeObjectForKey: (NSString*) kCTFontAttributeName];
return;
}
NSString* name = inFont.fontName; // Unrecognized selector
...
}
I'm getting an unrecognized selector exception on that last line.
(lldb) po [[self someUILabel] font]
$11 = 0x0beaf3d0 CTFont <name: .HelveticaNeueUI, size: 14.000000, matrix: 0x0>
CTFontDescriptor <attributes: <CFBasicHash 0xbeaf190 [0x3ec14d8]>{type = mutable dict, count = 1,
entries =>
1 : <CFString 0x189a838 [0x3ec14d8]>{contents = "NSFontNameAttribute"} = <CFString 0xbeaf7c0 [0x3ec14d8]>{contents = ".HelveticaNeueUI"}
}
--
Rick
_______________________________________________
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