Reputation: 11
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.
Upvotes: 1
Views: 332
Reputation: 85522
-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).
Upvotes: 5