how to solve invalid conversion specifier warning in iphone app

我只是一个虾纸丫 提交于 2019-12-11 02:00:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!