iphone - 如何解决 iphone 应用程序中的无效转换说明符警告

标签 iphone ios ipad uilabel

我有一个 iPhone 应用程序,其中为标签赋值但是当我构建它时它显示以下警告无效转换说明符 $

这里是标签赋值的代码。

label1.text=[NSString stringWithFormat:@"%d%$",newvalue1];

最佳答案

%$ 被解释为格式字符串说明符。您需要使用两个百分号转义 %$ 中的百分比:%%$,或者如果您只想要一美元​​,则删除第二个 %符号。

关于iphone - 如何解决 iphone 应用程序中的无效转换说明符警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16140488/

相关文章:

objective-c - Phonegap 全屏 iPad 应用程序

iphone - UIColor colorWithHue :saturation:brightness:alpha: always returning a red-tinted color 颜色

iphone - SQLite像查询多行

iphone - GCD、NSOperationQueue,还是手动创建线程?

ios - 如何在导航 Controller 工具栏的栏按钮项上添加标题和图像

C++ 代码中的 iPhone/iPad fatal error 在日志中不产生任何输出

ios - 如何在 ios 中使用不同颜色的 uibezierpath 创建堆叠条形图

iphone - 触摸后,Objective C 注释 View 显示缓慢

iOS App SQLite 数据库结构改变

jquery - Phonegap jQuery event.target 不工作