Re: Obj-C server and signal handling
Re: Obj-C server and signal handling
- Subject: Re: Obj-C server and signal handling
- From: Uli Kusterer <email@hidden>
- Date: Thu, 14 Feb 2008 20:54:17 +0100
On 14.02.2008, at 19:48, Matt Mashyna wrote:
I whipped up a little cocoafied server without a UI and it works
great, easy to read and all that good stuff but I'm stuck on one
last thing. I'm trying to catch a quit signal from Activity Monitor.
Force Quit definitely works but I'd like to be able to catch
whatever signal the Activity Monitor sends for the polite quit.
Doesn't seem to be sending a SIGQUIT, SIGTERM or anything like that.
Sometimes I see a SIGINT. I can catch signals sent from the terminal
fine. Is this the wrong way to go about this?
For a raw command-line tool, handling the right signal is what
you're expected to do (i.e. if you started with a "Foundation Tool"
target or similar).
If you actually created a bundled Cocoa application, but just
removed all the GUI stuff, you really should be running the NSApp you
have and have it take care of quitting. Or you could use Carbon/
CoreFoundation methods to register for the quit Apple Event, which is
what the OS seems to send every app in that case.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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