• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Knowing when application terminates...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Knowing when application terminates... (From: Albert Atkinson <email@hidden>)

  • Prev by Date: Re: Putting an Image Cell in NSTableView
  • Next by Date: Re: OS 9 Extension...
  • Previous by thread: Re: Knowing when application terminates...
  • Next by thread: Re: Knowing when application terminates...
  • Index(es):
    • Date
    • Thread