Re: Saving window and view state with NSDocument
Re: Saving window and view state with NSDocument
- Subject: Re: Saving window and view state with NSDocument
- From: Marek Hrušovský <email@hidden>
- Date: Tue, 22 Sep 2015 11:50:30 +0200
This is somewhat true.
I've just tested it with "NSQuitAlwaysKeepsWindows" and the restore
delegate is kicked when you quit app/launch app from the dock. However,
it's not called when you perform close on window (hit the red cross).
On Tue, Sep 22, 2015 at 10:56 AM, Mike Abdullah <email@hidden>
wrote:
>
> > On 22 Sep 2015, at 04:33, Kurt Sutter <email@hidden> wrote:
> >
> > Thanks for the info
> >
> >> BTW you decided to fight against framework (as others mentioned state
> restoration is responsible for this).
> >
> > The documentation on state restoration is somewhat sparse. However, as I
> understood, it only kicks in when I re-open an application. When the user
> opens a document after opening the application, state restoration would not
> restore that document — would it?
>
> My understanding is Apple’s state restoration does not kick in for your
> example.
>
> But in theory you could piggyback on top of the built-in support to
> implement your own. i.e. write a custom encoder/decoder. At save time, ask
> the document to save its state using that encoder, and store the result as
> part of the doc. When opening the doc, reverse the process to decode state.
_______________________________________________
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