0

我试验 NSIncrementalStore 和文档说“首先,持久存储协调器调用 gainPermanentIDsForObjects:error: .. 然后,协调器调用 executeRequest:withContext:error:”

在我的情况下, obtainPermanentIDsForObjects 方法不会被调用,但 executeRequest 将使用 NSSaveRequestType 参数调用。问题是什么?

我创建了一个 NSManagedObject 并调用了 save 方法。

4

1 回答 1

0

我试图将本地和远程存储添加到协调器,这导致阻塞了方法调用。所以我只是删除了第一行。

[_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options: @{NSSQLitePragmasOption : @{@"journal_mode" : @"DELETE"}} error:&error];
[_persistentStoreCoordinator addPersistentStoreWithType:@"CustomIncrementalStore" configuration:nil URL:nil options:nil error:&error];
于 2014-05-07T10:15:25.103 回答