Re: How to delay application quit?
Re: How to delay application quit?
- Subject: Re: How to delay application quit?
- From: Samvel <email@hidden>
- Date: Sun, 23 Mar 2008 22:36:51 -0500
That looks exactly as the functionality I was looking for.
Thus, the whole task should be divided into next steps:
1. Set delegate for current NSApp.
2. In above delegate implement -applicationShouldTerminate: method and
return NSTerminateLater.
3. Say, this delegate (or some other object) received Notification
saying that application is fine to quit now (after all necessary steps
performed) then call [NSApp replyToApplicationTerminate:YES] and
Application will proceed with quitting.
Is that right? Sorry, but I am a freshman in Mac programming :).
Samvel.
On Mar 23, 2008, at 10:24 PM, Sherm Pendley wrote:
On Sun, Mar 23, 2008 at 9:55 PM, Samvel <email@hidden> wrote:
Hi,
I have defined class (say, Download) that uses NSURLConnection to
download something from internet. My application is Cocoa with UI. I
want to call:
[Download cancel]
and wait for notification from this class once user quits application.
In your app delegate, implement -applicationShouldTerminate: to call
the above cancel method and return NSTerminateLater. Then, when the
cancellation is done, call [NSApp replyToApplicationTerminate:YES].
Or NO, to cancel the termination request.
sherm--
_______________________________________________
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