tags:

views:

188

answers:

2

When i use this line

  [UIFont fontWithName:@"Arial" size:16]  its work fine,but

   [UIFont fontWithName:@"Arial Black" size:16]  it crashes my app.....

In xib design there is the font name of Arial Black is available.But when i set using [UIFont fontWithName:@"Arial Black" size:16] this it crashes my app.. How can i set this font name to uilabel...

Can any one help me?

+1  A: 

Check the return value of +[UIFont fontWithName:size:]. My guess is that "Arial Black" is not being found, and a nil font is being returned. Setting a UILabel's font to nil will crash.

Ben Gottlieb
+1  A: 

To add - using +familyNames and +fontNamesForFamilyName methods in UIFont you can list all fonts available.

Vladimir