Re: Can't restore first responder when restoring window state

2017-02-16 Thread Quincey Morris
On Feb 16, 2017, at 12:43 , David Catmull wrote: > > I looked through the documentation, and didn't see anything that says you > shouldn't call those methods. Well, “encodeRestorableStateWithCoder:" > This method is part of the window restoration system and is called

Re: Can't restore first responder when restoring window state

2017-02-16 Thread David Catmull
I looked through the documentation, and didn't see anything that says you shouldn't call those methods. If they were meant to be overridden and not called, I expect they'd use something more opaque and special-purpose than NSCoder. As for being called twice, I don't see a problem, since they'll

Re: Can't restore first responder when restoring window state

2017-02-16 Thread Quincey Morris
On Feb 16, 2017, at 11:32 , David Catmull wrote: > > I am explicitly calling encodeRestorableState (in windowWillClose) and > restoreStateWithCoder (in windowDidLoad). You can’t. These methods — assuming you’re talking about overrides in (say) the window controller —

Re: Can't restore first responder when restoring window state

2017-02-16 Thread David Catmull
I am explicitly calling encodeRestorableState (in windowWillClose) and restoreStateWithCoder (in windowDidLoad), storing and reading the data to/from a file myself. I know those are normally used as part of the automatic app state restoration, but I want to restore a window's state regardless of

Re: Can't restore first responder when restoring window state

2017-02-16 Thread Quincey Morris
On Feb 16, 2017, at 10:09 , David Catmull wrote: > > I'm working on using encodeRestorableState/restoreStateWithCoder to save > and restore the state of a window. (I'm doing this manually because I want > to explicitly save my window state in the document and not just

Can't restore first responder when restoring window state

2017-02-16 Thread David Catmull
I'm working on using encodeRestorableState/restoreStateWithCoder to save and restore the state of a window. (I'm doing this manually because I want to explicitly save my window state in the document and not just rely on the OS restoring its state as part of restoring the application state.) The