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: Mike Abdullah <email@hidden>
- Date: Tue, 22 Sep 2015 09:56:02 +0100
> 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