获取编译ReactiveCocoa的错误

时间:2015-06-12 19:05:53

标签: ios objective-c cocoapods reactive-cocoa

我只是pod为这个新项目安装了这个Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

def import_pods
    pod 'Mantle'
    pod 'LBBlurredImage'
    pod 'TSMessages'
    pod 'ReactiveCocoa'
end

target 'WeatherJoy2' do
    import_pods
    link_with 'WeatherJoy2'
end

pod install成功但现在在构建项目时遇到以下错误:

/Users/ankit/Documents/WeatherJoy2/Pods/ReactiveCocoa/ReactiveCocoa/NSObject+RACKVOWrapper.m:49:3: Unknown type name 'rac_propertyAttributes'; did you mean 'mtl_propertyAttributes'?
/Users/ankit/Documents/WeatherJoy2/Pods/ReactiveCocoa/ReactiveCocoa/NSObject+RACKVOWrapper.m:49:40: Implicit declaration of function 'rac_copyPropertyAttributes' is invalid in C99

/Users/ankit/Documents/WeatherJoy2/Pods/ReactiveCocoa/ReactiveCocoa/NSObject+RACKVOWrapper.m:49:27: Incompatible integer to pointer conversion initializing 'mtl_propertyAttributes *' with an expression of type 'int'

项目中没有别的东西,这是一个新项目。我在xcode 6.2和OSX 10.9.5

1 个答案:

答案 0 :(得分:3)

在将Mantle和ReactiveCocoa一起使用时,我遇到了同样的问题。它似乎是由两个具有EXTRuntimeExtensions.h标头的pod引起的,这使得ReactiveCocoa导入标头的不兼容的Mantle版本(使用mtl_ vs rac_函数名称前缀。)

在我的情况下,我通过用#import "EXTRuntimeExtensions.h"

替换ReactiveCocoa pod中的每个#import "../Objective-C/extobjc/EXTRuntimeExtensions.h"来修复它