Skip navigation.
 
mlHow to delay application quit?
FROM : Samvel
DATE : Mon Mar 24 02:55:17 2008

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. 
Reasoning: my Download class should cancel connection and perform some 
operations before object can be released in program. Thus I can not 
simply deallocate Download instance in dealloc method.

So, the idea is: instead of calling [myDownload cancel] from dealloc 
method delay application quit until all steps are completed in 
Download. Thus call [myDownload cancel] and wait for Notification say 
DownloadCanceled. Only then deallocate object.

Is there any way to figure out when user initiated quit application? 
How to delay it?

I think there should be something pretty much similar to awakeFromNib 
but called at the very end upon application quit.

Thanks.

Related mailsAuthorDate
mlHow to delay application quit? Samvel Mar 24, 02:55
mlRe: How to delay application quit? Sherm Pendley Mar 24, 04:24
mlRe: How to delay application quit? Samvel Mar 24, 04:36
mlRe: How to delay application quit? Sherm Pendley Mar 24, 04:42
mlRe: How to delay application quit? Ken Thomases Mar 24, 21:12
mlRe: How to delay application quit? James Hober Mar 25, 17:26
mlRe: How to delay application quit? Steve Bird Mar 25, 17:34
mlRe: How to delay application quit? j o a r Mar 25, 17:44
mlRe: How to delay application quit? James Hober Mar 25, 23:19
mlRe: How to delay application quit? j o a r Mar 25, 23:26