在xcode中禁用和启用警告 [英] Disabling and enabling warning in xcode

查看:111
本文介绍了在xcode中禁用和启用警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以针对xcode中的某些特殊代码禁用警告? 我使用的不是我自己写的库,它会创建数百个警告.这使得很难找到与我的代码相关的警告. #import-header并在之后立即重新启用警告时,是否可以禁用? 我记得在其他一些IDE(可能是Visual Studio)或某些#pragma中,这是可能的. xcode有什么相似之处吗? 谢谢!

Is it possible to disable warnings for particular piecies of code in xcode? I'm using a library I didn't write myself, and it creates hundreds of warnings. This makes it very unclear to find warnings related to my code. Is it possible to disable when #import-ing the headers and re-enabling warnings immediately after? I remember this was possible in some other IDE, maybe Visual Studio, maybe with some #pragma. Anything similar in xcode? Thanks!

推荐答案

在XCode中打开您的项目,然后右键单击Targets文件夹中的目标.从下拉菜单中选择获取信息",然后向下滚动到有关编译器警告的部分(我的包装箱中的GCC 4.0警告).在这里,您可以禁用已激活的各种警告的复选框.还要检查其他警告标志"的值.这可能包括-Wall或-WMost,它们将启用其他警告.您可以删除它,希望您的警告不会出现.

Open your project in XCode, then right click on your target in the Targets folder. Select "Get Info" form the drop down menu and then scroll down to the section for the compiler warnings (GCC 4.0 Warnings on my box). Here you can disable the checkboxes for the various warnings you have active. Also check the value of "Other Warning Flags". This could include -Wall or -WMost which will enable other warnings. You can remove that and hopefully your warnings will not appear.

这篇关于在xcode中禁用和启用警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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