I'm writing Coredata document-based application (i.e. CoreData+NSPersistentDocument): as I create a new document, a new coredata stack is initialized, with a model and a single managed context.
Before the user saves the document, what I need to do is: - create a new context - create many new managed objects in it - merge the two contexts.
I issue save: on the new context, but it raises the exception "This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.".
How I can do? Should I need to save the document before this operation?
By the way, if I save the document, create a new context, import data and save the new context and finally save the document context, I get the following message: "This document’s file has been changed by another application since you opened or saved it."; any ideas?
Best regards!