7co*_*ows 27 xcode objective-c clang
我喜欢使用-Weverything
编译器来捕获所有可能的警告,但有时我得到警告,我不想修复.如何在发生时手动禁用这些特定警告?
小智 32
您可以使用-Wno-XYZ
XYZ作为要禁用的警告功能的名称来禁用单个警告.
max*_*max 16
在XCode 5中,我必须构建,然后右键单击某个问题并选择"在日志中显示",然后将"中间窗格"选项卡设置为"全部",同时获取日志中显示的问题.
然后单击右侧的"汉堡"图标并向下滚动我终于得到了警告的确切描述.
/.../SettingsViewController.m:91:58: warning: creating selector for nonexistent method 'setSegueIdentifier:' [-Wselector]
[segue.destinationViewController performSelector:@selector(setSegueIdentifier:)
Run Code Online (Sandbox Code Playgroud)
所以在我的情况下,以下工作.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wselector"
...
#pragma clang diagnostic pop
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
12368 次 |
最近记录: |