• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving window and view state with NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving window and view state with NSDocument


  • Subject: Re: Saving window and view state with NSDocument
  • From: Kurt Sutter <email@hidden>
  • Date: Mon, 21 Sep 2015 21:41:53 +0200

Isn’t state restoration something that goes into the app’s preferences (or somewhere else into the app’s container)? What I am looking for is some way to store that information in the document.

> On 21 Sep 2015, at 20:53, Quincey Morris <email@hidden> wrote:
>
> On Sep 21, 2015, at 11:09 , Kurt Sutter <email@hidden <mailto:email@hidden>> wrote:
>>
>> I want the state information of the windows and views to be stored in the document so that the same windows and views reopen when the user opens the document.
>>
>> What is the best way to do that? I guess I have to take two steps:
>>
>> (a) collect that state information in dataOfType:error: and store it in the NSData object to be returned and
>> (b) retrieve that data from the NSDocument in readFromData:ofType:error: and then somehow apply it in the NSDocument’s makeWindowControllers method.
>
> You don’t mention OS X state restoration:
>
> 	https://developer.apple.com/library/prerelease/mac/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/StandardBehaviors/StandardBehaviors.html <https://developer.apple.com/library/prerelease/mac/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/StandardBehaviors/StandardBehaviors.html>
>
> (under heading "Windows Are Restored Automatically”), but that sounds like what you’re looking for.
>
> Note that state restoration is extremely badly documented in Apple’s documentation. You’ll need to sift through API for individual classes and protocols, and sometimes look at the Obj-C header comments, to get a reasonably complete picture of what’s going on.
>
> There are probably some relevant WWDC videos, perhaps starting with "Resume and Automatic Termination in Lion” from 2011.

_______________________________________________

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


References: 
 >Saving window and view state with NSDocument (From: Kurt Sutter <email@hidden>)
 >Re: Saving window and view state with NSDocument (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Saving window and view state with NSDocument
  • Next by Date: Re: Error unwrapping an optional which isn't an optional
  • Previous by thread: Re: Saving window and view state with NSDocument
  • Next by thread: Re: Saving window and view state with NSDocument
  • Index(es):
    • Date
    • Thread