在添加启用iCloud的持久性存储时,Restkit 0.23.1

时间:2014-05-05 17:51:52

标签: ios core-data restkit icloud

使用具有iCloud启用同步标记的持久存储使用RestKit是否有任何成功? (无处不在的容器)

在将持久性商店添加到NSPersistentStoreUbiquitousContentNameKey: @"iCloudStore"时,我已将RKManagedObjectStore添加到选项列表中。执行时,我从未收到消息Using location storage: 0以指示指向iCloud的链接。

我的设置不正确吗?

// Managed Object Model setup
    modelURL = [[NSBundle mainBundle] URLForResource:@"MyModel"
                                  withExtension:@"momd"];
    model = [[[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL] mutableCopy];

    // RestKit Managed Object Store
    NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc]initWithManagedObjectModel:model];
    store = [[RKManagedObjectStore alloc] initWithPersistentStoreCoordinator:psc];

    // RestKit Persistent Store setup
    path = [DocumentsDirectory() stringByAppendingPathComponent:@"MyData.sqlite"];
    options = @{
                NSInferMappingModelAutomaticallyOption: @YES,
                NSMigratePersistentStoresAutomaticallyOption: @YES,
                NSPersistentStoreUbiquitousContentNameKey: @"iCloudStore"
                };

//Add persistent store
[store addSQLitePersistentStoreAtPath:path
                   fromSeedDatabaseAtPath:nil
                        withConfiguration:nil
                                  options:options
                                    error:&error];

我似乎在处理数据库种子时,将问题跟踪到RestKit中持久存储的交换。在打开RestKit问题之前,我只是想确保自己没有做过蠢事。

0 个答案:

没有答案