Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Compile 'em all

macrumors 601
Original poster
Apr 6, 2005
4,131
359
I am trying to use
Code:
UIFont* customfont = [UIFont fontWithName:@"customfontname" size:17];
label.font = customfont;

to set the font of a label to a custom font i have (i.e not the builtin iphone fonts) but i am getting an exception

Code:
 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: font != nil'

The font is located in the resources folder of the project, so I don't know why it can't find it. The above code works when I replace my font name with a builtin one like Helvetica. The font name is correct as far as I know. is there something i am missing? thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.