I experience an odd behaviour regarding saving an NSPersistentDocument. I can create a new document which is autosaved without an issue. But when I save it write(to: ofTyp
Good news and bad news
I have succeeded to reproduce the exact same error with Xcode 9.2 running on MacOS 10.13.2.
NSBinaryStoreSecureDecodingClasses
option.NSPersistentStoreCoordinator .migratePersistentStore()
aka -[NSPersistentStoreCoordinator migratePersistentStore:toURL:options:withType:error:]:
migratePersistentStore
, NSBinaryStoreSecureDecodingClasses
option is not set for both writing to and reading from a temporary file.Somewhat strange for me. Why the migration is executed upon saving, instead of upon opening a file? The lightweight migration has been already done at the step 3?
EDIT:
It seems that the name of migratePersistentStore
does not mean migration from old version to new version. It seems to mean migrate from an old persistent store with an old URL aka filename and/or file format to a new persistent store with a new URL and/or file format. So it is called when Save As... or Saving a new document which is already saved in an Autosave directory.