Core Data and NSOperation

后端 未结 4 911
情话喂你
情话喂你 2021-02-04 19:49

I\'m currently working with an NSPersistentDocument subclass that uses NSOperation to import data in the background. As per the documentation, I\'m obs

4条回答
  •  猫巷女王i
    2021-02-04 20:07

    I'm nobody's Core Data expert, but from what I can tell from the docs, you'll want to start with an in-memory store until the user (in their own time) saves the document. Then, send the coordinator a migratePersistentStore:toURL:options:withType:error: message to change over from the in-memory store to the new truly-persistent store. See that document for some essential details (particularly regarding the fate of the store you migrate).

提交回复
热议问题