在 Xcode 中,如何抑制特定源文件中的所有警告? [英] In Xcode, how to suppress all warnings in specific source files?

查看:25
本文介绍了在 Xcode 中,如何抑制特定源文件中的所有警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用触发一些警告的 3rd 方代码.我查看了它们,可以放心地忽略它们.

In my application I use 3rd party code that triggers some warnings. I reviewed them and they can be safely ignored.

现在我想以某种方式标记"一个文件,这样 Xcode 就不会对该文件中的代码显示任何警告.

Now I want to "mark" a file somehow, so Xcode won't show any warnings for the code in that file.

我该怎么做?

推荐答案

选择您的目标并显示构建阶段.然后在搜索框中输入文件名,您应该会看到它列在 Compile Sources 阶段.双击该文件的 Compiler Flags 列并输入 -w 以关闭该文件的所有警告.

Select your target and show Build Phases. Then enter the name of the file in the search box, and you should see it listed in the Compile Sources phase. Double-click in the Compiler Flags column for that file and enter -w to turn off all warnings for that file.

这篇关于在 Xcode 中,如何抑制特定源文件中的所有警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆