• 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: Can't restore first responder when restoring window state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: Can't restore first responder when restoring window state
  • From: David Catmull <email@hidden>
  • Date: Thu, 16 Feb 2017 13:43:52 -0700

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 just be
restored to the same values both times.

On Thu, Feb 16, 2017 at 1:22 PM, Quincey Morris <
email@hidden> wrote:

> On Feb 16, 2017, at 11:32 , David Catmull <email@hidden> 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 — are called by the state restoration system
> when it wants to. They’re there for you to override, not to call.
>
> If you do indeed call them, then they’re being called twice, at different
> times, which certainly sounds like it’s going to lead to problems.
>
>
_______________________________________________

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


  • Follow-Ups:
    • Re: Can't restore first responder when restoring window state
      • From: Quincey Morris <email@hidden>
References: 
 >Can't restore first responder when restoring window state (From: David Catmull <email@hidden>)
 >Re: Can't restore first responder when restoring window state (From: Quincey Morris <email@hidden>)
 >Re: Can't restore first responder when restoring window state (From: David Catmull <email@hidden>)
 >Re: Can't restore first responder when restoring window state (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Can't restore first responder when restoring window state
  • Next by Date: Re: Can't restore first responder when restoring window state
  • Previous by thread: Re: Can't restore first responder when restoring window state
  • Next by thread: Re: Can't restore first responder when restoring window state
  • Index(es):
    • Date
    • Thread