问题
I have iphone app in which assigning value to label but when i build this it shows following warning invalid conversion specifier $
here is the code of label assigning values.
label1.text=[NSString stringWithFormat:@"%d%$",newvalue1];
回答1:
replace like this why you keep %$
simply place $
symbol
label1.text=[NSString stringWithFormat:@"%d$",newvalue1];
回答2:
The %$
is being interpreted as a format string specifier. You need to escape the percent in %$
with two percent signs: %%$
, or remove the second %
if you just want a dollar symbol.
来源:https://stackoverflow.com/questions/16140488/how-to-solve-invalid-conversion-specifier-warning-in-iphone-app