Objective-C FontAwesome
Posted
by
sdover102
on Stack Overflow
See other posts from Stack Overflow
or by sdover102
Published on 2012-11-05T23:00:05Z
Indexed on
2012/12/04
23:04 UTC
Read the original article
Hit count: 134
I'm Attempting to get FontAwesome up and running on an iOS app and could use a little assistance. I have the following code for iOS:
UIBarButtonItem * viewDeckButton = [[UIBarButtonItem alloc]
initWithTitle:@"\uf0c9"
style:UIBarButtonItemStyleBordered
target:self.viewDeckController
action:@selector(toggleLeftView)];
NSDictionary * customTextAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"FontAwesome" size:14.0],
UITextAttributeFont,
nil];
[viewDeckButton setTitleTextAttributes:customTextAttrs forState:UIControlStateNormal];
@"\uf0c9"
corresponds to the css class, icon-reorder. The font appears to be installed on my system (see http://cl.ly/image/2F1x1z2H0i2N). I'm getting the standard box character, as if the font is not loaded (see http://madmonkdev.com/badchar.png).
Any help would be appreciated.
© Stack Overflow or respective owner