The Correct Place to Migrate my NSDocument


Bill Pitcher
 

I have an App that needs to be upgraded (thanks App Store) and I want the new App to Open and migrate it’s old documents to the new versions document. With the new File Type and Extension.

All good, I can open both types in "override func read(from data: Data, ofType typeName: String) throws”.
And the internal data is all good.

But when it saves (Including the automagical save when quitting) the new migrated data gets put into the old file, keeping the old DocumentType and Extension. (If I change the file extension manually in Finder it then opens fine)

I get the feeling that either I’m no doing this in the right place or I’m missing something obvious.

Any advice or examples greatly appreciated.

cheers
Bill Pitcher
bill@...

Join {cocoa@apple-dev.groups.io to automatically receive all group messages.