2015-12-12 60 views
0

我決定在這裏問這個問題,因爲我一直在尋找解決方案。'RKManagedObjectRequestOperation'類消息是一個前向聲明

我只通過CocoaPods將RestKit集成到我的項目中。我在使用ElCapitan的iOS 9和最後一個版本的XCode(7.2) 一切正常,直到XCode中的構建步驟。

我等以下錯誤

接收機「RKManagedObjectRequestOperation」類消息爲轉發聲明

請參閱生成錯誤的代碼如下: Code sample

RKManagedObjectRequestOperation *operation = [[RKManagedObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]]; 
operation.managedObjectContext = managedObjectStore.mainQueueManagedObjectContext; 
operation.managedObjectCache = managedObjectStore.managedObjectCache; 
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) { 
    //Product *product = [result firstObject]; 

但是,我想我正確地導入了庫RestKit/CoreD ATA: I declared RestKit/CoreData

而且還前綴頭:

#import <Availability.h> 

#if __IPHONE_OS_VERSION_MIN_REQUIRED 

    #ifndef __IPHONE_5_0 
    #warning "This project uses features only available in iOS SDK 5.0 and later." 
    #endif 

    #ifdef __OBJC__ 
     #import <UIKit/UIKit.h> 
     #import <Foundation/Foundation.h> 
     #import <RestKit/CoreData.h> 
     #import <SystemConfiguration/SystemConfiguration.h> 
     #import <MobileCoreServices/MobileCoreServices.h> 
    #endif 

    #else 
     #ifdef __OBJC__ 
     #import <Cocoa/Cocoa.h> 
     #import <SystemConfiguration/SystemConfiguration.h> 
     #import <CoreServices/CoreServices.h> 
    #endif 

#endif 

我想請求在這個問題上你的幫助。 「接收者類型'RKManagedObjectRequestOperation'例如消息是前向聲明。」

有什麼我應該檢查在構建設置等?

回答

0

RKManagedObjectRequestOperation不是CoreData.h頭文件之下,而是Network.h頭文件,所以我會在您的列表:

+0

謝謝!其實現在好多了! Grazie Mille – keepmeahug