Re: Restoring unsaved docs does wrong thing
Re: Restoring unsaved docs does wrong thing
- Subject: Re: Restoring unsaved docs does wrong thing
- From: Quincey Morris <email@hidden>
- Date: Mon, 15 Apr 2013 14:19:17 -0700
On Apr 15, 2013, at 13:49 , Steve Mills <email@hidden> wrote:
> I have the following overrides in my NSDocument subclass:
> […]
You didn't mention "autosavesInPlace". This is the one to override if you don't want any (new-style) autosaving.
> The data was never saved anywhere, so opening a new document is the wrong thing for the OS to do.
No, that's not true when "autosavesInPlace" is YES. In that case, if the app has a window open when it quits, it should and will open a window when it re-starts. If autosave has never completed, it'll be a new, untitled window.
Having said that, things get a bit more complicated when you kill the app during debugging. It's a bit unpredictable what restorable state has been saved, and whether it'll successfully restore. You can turn off the "Launch application without state restoration" option in the Run action of the scheme, which make help you out during debugging, though that of course won't prevent the behavior in normal usage for your users.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden