tags:

views:

26

answers:

1

Hi i am using following code.

NSString *quant = [NSString stringWithFormat:@"%@",item.capacity];
NSString *metricUnit = item.metric_Unit;
cell.quantity.text = [quant stringByAppendingFormat:metricUnit];

while quant is nsnumber and i m getting a warning named "format is not a string literal and no format arguments" and i m trying many was but did nt success, plzz if any one know how to remove that warning plzz tell ...

Hope your positive response

+3  A: 

The warning is self-descriptive - api expects format you're passing to stringByAppendingFormat function to be a string literal. To avoid this warning you can just append a string (as you don't use format parameters anyway):

cell.quantity.text = [quant stringByAppendingString:metricUnit];

or

cell.quantity.text = [quant stringByAppendingFormat:@"%@",metricUnit];
Vladimir
thnx alot its working fine :)
Abhishek