使用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也会产生类似的问题。 所以,要开启这个参数,需要谨慎,不要因为一些小小洁癖耽误自己大量的时间。

使用CocoaPods之后的头文件包含问题

使用了一段时间CocoaPods来管理Objective-c的类库,方便了不少。但是有一个小问题,当我在xcode输入import关键字的时候,没有自动联想补齐代码的功能,需要手工敲全了文件名,难以适应。 在stackoverflow上找到了解决办法: Go to the Target > \”Build Settings\” tab and find the \”User Header Search Paths\” setting. Set this to \”$(BUILT_PRODUCTS_DIR)\” and check the \”Recursive\” check box. Now the built target will search the workspace’s shared build directory to locate the linkable header files. 简单说就是这么几步: 选择Target -> Build Settings 菜单,找到\”User Header Search Paths\”设置项 新增一个值$(BUILT_PRODUCTS_DIR),并且选择\”Recursive\”,这样xcode就会在项目目录中递归搜索文件 […]