简体   繁体   English

如何禁用“ NSInteger类型的值”不应用作格式参数; 而是在“ long”中添加明确的强制转换”

[英]How to disable “Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead”

How to disable the following warning in Xcode: 如何在Xcode中禁用以下警告:

Values of type 'NSInteger' should not be used as format arguments; “ NSInteger”类型的值不应用作格式参数。 add an explicit cast to 'long' instead 添加一个明确的强制转换为'long'

Please note that I want to disable the warning only, I know can cast the NSInteger to long, but I don't want to. 请注意,我只想禁用警告,我知道可以将NSInteger转换为long,但是我不想这样做。

您可以仅将%zd用于NSInteger,而禁用警告使用#pragma

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM