使用CocoaPods时开启inhibit_warnings参数的小问题

inhibit_warnings参数能够有效的抑制CocoaPods引入的第三方代码库产生的warning,但是有时候会产生意想不到的错误,例如我今天引入ReactiveCocoa的时候就产生了下面的错误:

CompileDTraceScript ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoa/RACSignalProvider.d
    cd /Users/Tony/Code/TestApp/Pods
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/Tony/.rvm/gems/ruby-1.9.3-p194/bin:/Users/Tony/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/Tony/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/Tony/.rvm/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/heroku/bin:/usr/local/git/bin:/usr/local/share/npm/bin:/Applications/MAMP/Library/bin:/Users/Tony/Applications/play:/Users/Tony/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/git/bin:/usr/local/sbin:/Users/Tony/.rvm/bin:/Users/Tony/.ec2/bin"
    /usr/sbin/dtrace -h -DOS_OBJECT_USE_OBJC=0 -fobjc-arc -DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-checker -s ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoa/RACSignalProvider.d -o /Users/Tony/Library/Developer/Xcode/DerivedData/TestApp-bfkcwbnhjkdedddkxicxplyvlnxq/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-ReactiveCocoa.build/DerivedSources/RACSignalProvider.h

......

Command /usr/sbin/dtrace failed with exit code 2


而我的pod文件中引入方式如下:


pod 'ReactiveCocoa', '~> 2.1', :inhibit_warnings => true

在这里,关闭了inhibit_warnings之后,就可以正常编译了。同理,inhibit_all_warnings也会产生类似的问题。

所以,要开启这个参数,需要谨慎,不要因为一些小小洁癖耽误自己大量的时间。

作者: 发表于October 21, 2013 at 8:08 pm

版权信息: 可以任意转载, 转载时请务必以超链接形式标明文章原始出处作者信息及此声明

Tags:

评论已关闭。