I\'m trying to add a custom font to my project in Xcode 4.2, but whenever I try to use it, I get a error that the object is nil.
I have done the following:
1) Ad
Have you put a breakpoint in and checked that you are getting a valid UIFont object for myFont. This is worth checking as most likely the issue is that "LCDMono2 Ultra" is actually the font family name and what you want to be using is something like "LCDMono2 Ultra-normal" or "LCDMono2 Ultra-bold". Open your .ttf with Font Book and see what info it gives you.
Alternatively if you can't find anything in Font Book you could try calling:
NSArray *fonts = [UIFont fontNamesForFamilyName:"LCDMono2 Ultra"];
And then just printing the array fonts in the debugger to check what they should be.
Hope this help, let me know if this doesn't work and i'll try to think of something else :)