Re: what are the scenarios for an app to be terminated?
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