Using Custom Fonts with UIFont Exception

Discussion in 'iPhone/iPad Programming' started by Compile 'em all, Jan 19, 2009.

  1. macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
    #1
    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
     

Share This Page