I'll need to implement asynchronous saving in a Core Data document-based application. My NSDocument
subclass is patterned just like iOS' UIManagedDocument
with a pair of NSManagedObjectContext
instances, one for the main thread with a parent context for background saving.
The problem is that whenever I the document, the app always displays a prompt:
The document ... could not be saved. The file has been changed by another application.
I wonder what is missing from my implementation? How can I make the dialog above go away whenever I save?
You can find my NSDocument
subclass in this gist: https://gist.github.com/3652120