My app is just using a single file with data created through NSCoding and NSKeyedArchiver.
Looks Ike I spoke too soon with it working though.
I've created a template file using my data format which gets copied as in the wwdc session when a new document is created. It does get copied into the documents directory, it shows up in the doc browser and when I tap it I get a call to didPickDocumentURLs. All good, until I change the data and trigger the document to save. When that happens I get a big splurge of errors in the log and something seems to go wrong with the file. Once this has happened I can't open the file again or even create a new one.
I hoped that this was just some issue with my app or data so I started again from scratch with the XCode template and a very basic data file that saves just one integer. Same problem. I've checked the contents of the template file and post save data file and they both look perfectly fine, the saved one just doesn't load anymore!
These are the errors that I get. Are you getting anything similar? The old xcode 8 version of my app was working with documents in almost the same way and doesnt show any errors like this.
2017-06-19 20:37:33.182683+0100 docTestios11[93120:1101660] [default] [ERROR] Could not get attribute values for item file:///Users/chris/Library/Developer/CoreSimulator/Devices/45365600-9AD0-475B-B585-9A240FD4BCED/data/Containers/Data/Application/EB40D1E0-4D5B-4023-BBB3-18765B5DAC3E/Documents/Template.myfile. Error: Error Domain=LocalStorageFileProvider.LocalFileProviderError Code=0 "(null)"
-Chris