Re: Termination notifications in foundation tool?
Re: Termination notifications in foundation tool?
- Subject: Re: Termination notifications in foundation tool?
- From: Luke Evans <email@hidden>
- Date: Sat, 5 Sep 2009 22:26:10 -0700
A big thanks, Dave, Jens and Greg.
The example code looks particularly promising.
There's so much buried in the various Apple samples, but finding what
you want is nigh impossible without having stumbled on thing before
(and having a good memory).
Some sort of concept index for all samples would be useful, but
admittedly that would be a lot of work to do effectively.
Anyway, thanks again for the tip.
On 2009-09-05, at 3:02 AM, email@hidden wrote:
What I've done in the past is install a signal handler which tells
the OS to
ignore the signal, but also schedules a future callback on the main
thread
(via the runloop) that will then cleanly shut down the process. You
probably
want to catch the signals generated by Ctrl-C or a 'kill' command;
IIRC that
would be SIGINT, but my memory is hazy.
Here's some example code:
http://developer.apple.com/mac/library/samplecode/PreLoginAgents/listing2.html
See InstallHandleSIGTERMFromRunLoop()
_______________________________________________
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