I have an OS X app that relies on NSPersistentDocument and Core Data to handle the app's custom file type (which is being saved as XML).
I've noticed that when I update my Core Data model (I'm making simple changes, relying on lightweight migration) simply opening a file with the app that's utilizing the new model will change the file on disk. A backup version of the original file also appears on disk (with a '~' appended to the file name). Once this happens, it's impossible for the previous (released) version of the app to open the file.
To be clear: I'm simply opening the file. I am not saving the file back to disk. I can watch in the Finder and see the '~' appear as soon as I open a file.
This seems like really dangerous behavior. I have to be very cautious and not ever open a file that's currently in use by my user base because doing so will instantly make it inaccessible to them.
Is this default OS X behavior? Is there a way to configure NSPersistentDocument or my Core Data model so that opening a file changes the store internally to the app but the changes don't get propagated back to disk unless I explicitly save?