I'm trying to set the infamous NSFontAttributeName property of an NSAttributedString in iOS but it just doesn't seem to work:
this doesn't work:
CTFontRef ctFont = CTFontCreateWithName((CFStringRef)[UIFont boldSystemFontOfSize:16].fontName, [UIFont boldSystemFontOfSize:16].pointSize, NULL);
[myAttString addAttribute:(NSString*)kCTFontNameAttribute
value:(id)ctFont
range:NSMakeRange(0, myAttString.length-1)];
this doesn't work:
[myAttString addAttribute:(NSString*)kCTFontNameAttribute
value:[UIFont boldSystemFontOfSize:16]
range:NSMakeRange(0, myAttString.length-1)];
Is there anyway to make this work?
I found it!
basically, turns out the string constant for the dictionary key I should been using is kCTFontAttributeName
This whole thing is a show...