简体   繁体   English

Xcode不显示来自CocoaPods Pod的警告

[英]Xcode Don't Display Warnings From CocoaPods Pods

When building my project I have a lot of warnings from CocoaPods Pods. 在构建我的项目时,我收到了很多来自CocoaPods Pods的警告。 So other projects that I don't have control of. 所以我无法控制的其他项目。

What is the suggested way to handle this? 建议的方法是什么? I'd prefer to have Xcode only display warnings related to my project. 我更喜欢Xcode只显示与我的项目相关的警告。 It just gets to be too much if it displays warnings related to projects I don't have control over. 如果它显示与我无法控制的项目相关的警告,那就太多了。

There is two way to get it done: 有两种方法可以完成它:

Method 1 方法1

  1. Go to your pod project's Build Settings tab 转到pod项目的Build Settings选项卡
  2. Search for inhibit_all_warnings flag 搜索inhibit_all_warnings标志
  3. Set it to YES 将其设置为YES

It'll suppress all the warning related to the pod project. 它将抑制与pod项目相关的所有警告。 But when you do next pod install the flag will be reset to NO . 但是当您执行下一个pod install该标志将重置为NO

禁止所有警告

Method 2 方法2

In your podfile specify inhibit_all_warnings! 在你的podfile指定inhibit_all_warnings! key like following: (This will avoid the inhibit warning flag resetting with each pod install issue. Do a pod install after adding this flag.). 密钥如下:(这将避免在每个pod安装问题时重置禁止警告标志。添加此标志后执行pod安装。)。

platform :ios, '9.0'
inhibit_all_warnings!

target 'MyApp' do
   # Your Pods
end

Reference: Podfile Syntax 参考: Podfile语法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM