Skip navigation.
 
mlRe: Obj-C server and signal handling
FROM : Uli Kusterer
DATE : Thu Feb 14 20:54:17 2008

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

Related mailsAuthorDate
mlObj-C server and signal handling Matt Mashyna Feb 14, 19:48
mlRe: Obj-C server and signal handling Dave Camp Feb 14, 20:32
mlRe: Obj-C server and signal handling Dave Camp Feb 14, 20:41
mlRe: Obj-C server and signal handling Uli Kusterer Feb 14, 20:54