tags:

views:

50

answers:

2

Warning: incompatible Objective-C types 'struct NSArray *', expected 'struct UIFont *' when passing argument 1 of 'setFont:' from distinct Objective-C type

Code Like:

lblTemp.font = [UIFont fontNamesForFamilyName:@"Arial"]; // Warning comes here    
lblTemp.font = [UIFont fontWithName:@"Arial-BoldMT" size:13];    
[cell.contentView addSubview:lblTemp];    
[lblTemp release];

Please give some suggestion to solve to it.

+5  A: 

-fontNamesForFamilyName: returns an array of font names, not a UIFont. You'll want to pass one of the strings in this array to +[UIFont fontWithName:size:] to get a UIFont object back (as you do in the next line).

Ben Gottlieb
+1  A: 

[UIFont fontNamesForFamilyName:@"Arial"];
does not return the Arial font, it returns the array of font names for the Arial font family. Check the manual here

taskinoor