Re: display a window while quitting
Re: display a window while quitting
- Subject: Re: display a window while quitting
- From: Keary Suska <email@hidden>
- Date: Mon, 03 Dec 2007 15:10:26 -0700
- Thread-topic: display a window while quitting
on 12/3/07 9:58 AM, email@hidden purportedly said:
> I want to be able to display a window saying that the app is quitting
> while quitting, but I only want it to display if there is a wait
> greater than 2 seconds. I attempted creating a timer in
> applicationWillTerminate: but it did not fire. Is there a way to do
> this?
Chances are, this is either because you never return control to the run
loop, so the timer can never fire; or you return control to the run loop and
your app terminates (probably before your cleanup code is complete).
The easiest choice that comes to mind is to implement
-applicationShouldTerminate: and return NO if you haven't run the cleanup,
or YES if you have. Make sure your cleanup code runs "asynchronously"--i.e.
returns control to the run loop so your timer will fire. On completion, flag
that cleanup is done and call -terminate: on NSApp to actually exit.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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