• 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: Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?


  • Subject: Re: Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?
  • From: Daryle Walker <email@hidden>
  • Date: Sat, 05 Mar 2016 02:09:15 -0500

> On Mar 2, 2016, at 1:25 PM, Quincey Morris <email@hidden> wrote:
>
> On Mar 2, 2016, at 10:00 , Daryle Walker <email@hidden <mailto:email@hidden>> wrote:
>>
>> If this is a policy change …
>
> Yes and no.
>
> With state restoration enabled (the default), the application re-launches to the same state as when it terminated. If there was no untitled window at quit, there’s none when it starts again.
>
> I’d suggest you avoid trying to “fix” this by opening an untitled window. Under some circumstances, the system is free to terminate your app’s process and then to restart it later. Your fix would cause untitled windows to appear magically at random times, from the user’s point of view.
>
> You can verify that your app is handling the app delegate message correctly by using the scheme option to run your app from Xcode without state restoration. Other than that, go with the flow, and let the system do what it wants to do with state restoration. Alternatively, you could opt out of state restoration completely.

When I changed the initial position of the window in Interface Builder, the initial window didn’t change position on re-run, although new windows did match the updated coordinates. I knew that State Restoration was the cause. It never clicked that SR would affect my issue too! This category of changes has its well poisoned by SR as soon as you run your app once pre-changes. Turning off SR in the scheme panel, and commenting out my explicit code, showed the Apple’s default code is still there.

I’m satisfied that the code does technically work. So i’ll remove the explicit code and let everything run as (hopefully) planned.

—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

_______________________________________________

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: 
 >Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion? (From: Daryle Walker <email@hidden>)
 >Re: Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Customizing a UISwitch?
  • Next by Date: Re: Starting out with storyboards (on Mac)
  • Previous by thread: Re: Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?
  • Next by thread: migrating from 32bit to 64 bit can not run project
  • Index(es):
    • Date
    • Thread