It appears the system is throwing the sessions away because the watch dog timer killed the app.
After 5 seconds after hitting command-q, I see this in the console.
[Lifecycle] Watchdog: App took too long to enter the background-only state. Exiting immediately! (5.0s)
[Lifecycle] Watchdog timeout. Exiting immediately. (App took too long to enter the background-only state.)
[Assert] App took too long to enter the background-only state.
When I pull up the Console console, I get a serious of incomprehensible excuses for not saving the document.
Code Block UIDocument unrecoverable error with description: You don’t have permission to save the file “Untitled.txt” in the folder “Documents”. reason: You don’t have permission. |
Code Block Failed to recover from error with description: You don’t have permission to save the file “Untitled.txt” in the folder “Documents”. reason: You don’t have permission. |
Why not? I opened it? I have read/write permissions in the entitlements.
Code Block Sandbox: MyAppName(5631) deny(1) file-read-data /Users/myusername/Documents/mydocument.txt |
Why? If I close the doc by dismissing the view controller and calling .close directly, it saves successfully. So how did I lose permissions to save my work just because I'm quitting the app? Seems like a major major major design flaw in the OS.