UIFont *font = [UIFont fontWithName:kOcticonsFamilyName size:(float)((int)fontSize)];
After execute this line of code, font still was nil.
kOcticonsFamilyName = @"Octicons"; but the font file "octicons.ttf" belong assets.bundle, not in main bundle, so it can't add to copy bundle resources. I guess this is the problem, but how to fix it? Hope your reply! @leichunfeng
UIFont *font = [UIFont fontWithName:kOcticonsFamilyName size:(float)((int)fontSize)]; After execute this line of code, font still was nil. kOcticonsFamilyName = @"Octicons"; but the font file "octicons.ttf" belong assets.bundle, not in main bundle, so it can't add to copy bundle resources. I guess this is the problem, but how to fix it? Hope your reply! @leichunfeng