【问题标题】:IOS Chart compiler warnings with Xcode 11.5 [duplicate]Xcode 11.5的IOS Chart编译器警告[重复]
【发布时间】:2020-09-15 12:08:13
【问题描述】:

我刚刚升级到 11.5。编译器现在抛出 IOS 图表的警告 (var -> let)。是否可以仅为 Charts 模块删除这些,即我不想删除我自己代码的其余部分的警告(我不愿意进入 Charts 模块并更改源,即使更改是微不足道的) .

【问题讨论】:

    标签: swift xcode11 ios-charts


    【解决方案1】:

    转到目标的Build Settings 并将Inhibit All Warnings 设置为YES

    如果您使用的是 cocoapods,您可以通过将这些行添加到您的 Podfile 中来自动将其设置为 YES

    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
    

    只需在您的Podfile 顶部声明inhibit_all_warnings!

    如果您想禁用/启用特定 pod 的警告,请在 pod 行中使用 :inhibit_warnings => true:inhibit_warnings => false。然后你应该执行pod install

    platform :ios
    
    # ignore all warnings from all pods
    inhibit_all_warnings!
    
    # ignore warnings from a specific pod
    pod 'Charts', :inhibit_warnings => true
    

    Cocoapods Inhibit All Warnings Documentation

    【讨论】:

    • 谢谢,这行得通,我使用您的反馈来编辑我在 Xcode 项目导航器的 Pods 项目下找到的 podfile。感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 2015-01-01
    • 1970-01-01
    • 2017-09-05
    • 1970-01-01
    • 2014-06-10
    • 2011-02-20
    • 2011-05-09
    相关资源
    最近更新 更多