Search code examples
iosobjective-ciphoneuidocument

UIDocument with Autosave when is the file saved


I setting up UIDocument to save my files to the device. I mark a file needs to be saved with

[ myDoc updateChangeCount:UIDocumentChangeDone ]

Now it appears that the saving operation only kicks in when one is leaves the app. Now what would happen if I dereference the file when I have the file open, thinking that I have its content saved already, would the autosave kick in before the file is dereferenced.

Thanks Reza


Solution

  • If you're done with a UIDocument, you should close it using UIDocument closeWithCompletionHandler: