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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]