> On Mar 2, 2016, at 1:25 PM, Quincey Morris 
> <[email protected]> wrote:
> 
> On Mar 2, 2016, at 10:00 , Daryle Walker <[email protected] 
> <mailto:[email protected]>> 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 protected])

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 [email protected]

Reply via email to