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 > <quinceymor...@rivergatesoftware.com> wrote: > > On Sep 21, 2015, at 11:09 , Kurt Sutter <k...@quansoft.com > <mailto:k...@quansoft.com>> 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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com