Core Data and NSOperation

后端 未结 4 901
情话喂你
情话喂你 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条回答
  •  死守一世寂寞
    2021-02-04 20:15

    My first thought on the workflow/saving part would be, if a persistent store hasn't yet been created for the document, to create a temporary in-memory store, so that the imported data would be saved to that store instead (though the document/window would still be marked as dirty). Then, once the user saves the document for real, you would reconfigure the coordinator to remove the in-memory store and replace it with the on-disk store, so all further saves would go to disk.

提交回复
热议问题