I have a Mac doc based app. I have save methods setup (they sort of work... I'm trying to get them up and running) I'm using NSSecureCoding, with NSObjects in Swift. It has been unusually frustrating.
I have run into something I find wildly difficult to even explain. I can save a new document that has not been saved yet. it loads as expected. but if I make a change to a doc I have already saved, and save that, ny file gets wiped out. my save code is called, and the app wipes all of the data out of the saved file. The file exists, but it's emptied.
it goes from around ~200k in size to 2k in size.
there's no error that I have identified. It just wipes my file. So I have NO idea if it's something I did.
docs are... unhelpful. internet searches... are unhelpful. this is just one of a number of errors I have to figure out, but it is massively complicating everything else.
any ideas welcome.