• 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
Re: what are the scenarios for an app to be terminated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what are the scenarios for an app to be terminated?


  • Subject: Re: what are the scenarios for an app to be terminated?
  • From: Conrad Shultz <email@hidden>
  • Date: Thu, 7 Oct 2010 00:38:04 -0700

On Oct 6, 2010, at 12:13, eveningnick eveningnick <email@hidden> wrote:

> Maybe it's a wrong way to use
> -dealloc also as a destructor (like i did in C++) - where i save
> config file? what is the right way?

In addition to the valid and good responses others have given you about watching for the termination notification, I thought I'd chime in on the specific thing you say above.

If you have actual _configuration_ items (i.e. something other than window locations and minor details that won't be determined until the moment of termination), perhaps you should consider writing them out BEFORE termination. You could save in real time on a separate thread if appropriate, at defined intervals, when enough changes have accumulated, or through some other means.

This has some potential advantages:

1) More consistent state, especially if a crash, regardless of fault, takes down your app non-gracefully. This can also apply to power failures and other mishaps.

2) Faster termination, which users are probably more likely to notice than the intermittent disk write during normal use.

I'm not saying this is right for every application, but is food for thought.

--
Conrad Shultz
www.synthetiqsolutions.com_______________________________________________

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

References: 
 >what are the scenarios for an app to be terminated? (From: eveningnick eveningnick <email@hidden>)

  • Prev by Date: How does Popup menu receive keyboard events?
  • Next by Date: Re: Let the runloop process its queue during a long operation
  • Previous by thread: Re: what are the scenarios for an app to be terminated?
  • Next by thread: Re: what are the scenarios for an app to be terminated?
  • Index(es):
    • Date
    • Thread