PDA

View Full Version : Using Custom Fonts with UIFont Exception




Compile 'em all
Jan 19, 2009, 08:36 PM
I am trying to use

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


*** 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