• 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
How to delay application quit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to delay application quit?


  • Subject: How to delay application quit?
  • From: Samvel <email@hidden>
  • Date: Sun, 23 Mar 2008 20:55:17 -0500

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.
_______________________________________________

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


  • Follow-Ups:
    • Re: How to delay application quit?
      • From: Ken Thomases <email@hidden>
    • Re: How to delay application quit?
      • From: "Sherm Pendley" <email@hidden>
  • Prev by Date: Re: NSTreeController / CoreData still broken in 10.5?
  • Next by Date: Re: [ANN] RegexKitLite
  • Previous by thread: CARenderer Memory Issue
  • Next by thread: Re: How to delay application quit?
  • Index(es):
    • Date
    • Thread