Mic*_*ine 60 xcode compiler-warnings suppress-warnings xcode4.2
我已将three20项目导入到我的项目中,当我使用iOS 5升级到Xcode 4.2时,项目中出现了一堆警告.
我不关心它们,但它们会产生很多噪音,现在很容易错过我项目中的任何真实警告.有没有办法禁用这些特定库的警告?
iHu*_*ter 147
如果将第三方库添加为单独的目标,则可以检查Inhibit all warnings该特定目标以关闭所有警告.
如果将库作为普通源文件添加到当前目标,则可-w以为各个源设置编译器标志以将其中的所有警告静音.您必须转到Build phases目标配置的菜单,并Compile Sources通过双击每个文件结束输入-w标志为部分中的每个源文件设置此标志.

Ala*_*bib 11
如果您使用的是pod,则可以将其添加到podfile中以防止警告日志记录:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = "YES"
end
end
end
Run Code Online (Sandbox Code Playgroud)
如果警告来自包含的库或框架头文件,您可以像这样包装包含语句:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
#pragma clang diagnostic pop
Run Code Online (Sandbox Code Playgroud)
将警告标志放在上面的第二行。您可以在此处查找警告标志:https : //clang.llvm.org/docs/DiagnosticsReference.html
| 归档时间: |
|
| 查看次数: |
23702 次 |
| 最近记录: |