Re: Knowing when application terminates...
Re: Knowing when application terminates...
- Subject: Re: Knowing when application terminates...
- From: Philip George <email@hidden>
- Date: Thu, 18 Jul 2002 13:42:48 -0500
one line of code that should go in your app's startup code plus your
handler method:
...
// somewhere in your startup code
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
selector:@selector(somethingjustquit:)
name:@"NSWorkspaceDidTerminateApplicationNotification"
object:nil];
...
// handler method
- (void)somethingjustquit:(NSNotification *)notif {
NSLog(@"%@",[notif description]);
}
Reading the output of that NSLog() will give you some idea of how to
figure out if the application you're interested in is the app that just
quit. For whatever reason, by the way, not ALL apps trigger this
notification when they quit, for instance TextEdit.app, but BBEdit
does. Not sure why. Let's hope the app you're interested in does.
:)
- Philip
On Thursday, July 18, 2002, at 12:17 PM, Albert Atkinson wrote:
>
NSWorkspaceDidTerminateApplicationNotification
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.