小编Cal*_*att的帖子

在'RKObjectManager'类型的对象上找不到属性'managedObjectStore'

我一直在尝试使用Restkit库的0.20.3版本.最近出现了一个错误,我无法弄清楚如何解决.它是以下内容:

在'RKObjectManager*'类型的对象上找不到属性'managedObjectStore'

它发生在包含的行

objectManager.managedObjectStore = managedObjectStore;

下面列出了我的一小段代码,以帮助识别.我使用CocoaPods来安装所有必需的库,一切似乎都正确链接.

#import "AppDelegate.h"
#import <RestKit/RestKit.h>
#import <RestKit/CoreData.h>
#import <CoreData/CoreData.h>
#import <RestKit/ObjectMapping.h>
#import "Temperature.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:    (NSDictionary *)launchOptions
{

    //let AFNetworking manage the activity indicator
    [AFNetworkActivityIndicatorManager sharedManager].enabled = YES;

    // Override point for customization after application launch.
    RKObjectManager *objectManager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"http://grid.no-ip.biz/grid"]];
    NSURL *modelURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Grideye" ofType:@"momd"]];

    //Initialize managed object store
    NSManagedObjectModel *managedObjectModel = [[[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL ] mutableCopy];
    RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];

    objectManager.managedObjectStore = …
Run Code Online (Sandbox Code Playgroud)

ios restkit restkit-0.20

29
推荐指数
3
解决办法
3822
查看次数

标签 统计

ios ×1

restkit ×1

restkit-0.20 ×1