【问题标题】:How to disable "Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead"如何禁用“'NSInteger' 类型的值不应用作格式参数;改为将显式强制转换添加到 'long'”
【发布时间】:2016-02-26 05:54:09
【问题描述】:

如何在 Xcode 中禁用以下警告:

“NSInteger”类型的值不应用作格式参数;改为将显式强制转换为“long”

请注意,我只想禁用警告,我知道可以将 NSInteger 转换为 long,但我不想这样做。

【问题讨论】:

  • 您是否找到了构建应用程序的实际方法?更新到最新的xcode后不让我
  • @octohedron 不,我没有。我认为 %zd 适用于 Mac(64 位),但不适用于可以同时获得 32 位和 64 位的 iOS

标签: objective-c xcode


【解决方案1】:

你可以只对 NSInteger 使用 %zd 而不是禁用警告使用 #pragma

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-11
    • 1970-01-01
    • 1970-01-01
    • 2016-02-19
    • 2014-08-01
    • 2011-10-19
    • 2016-09-24
    相关资源
    最近更新 更多