• 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: NSWorkspaceDidLaunchApplicationNotification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWorkspaceDidLaunchApplicationNotification


  • Subject: Re: NSWorkspaceDidLaunchApplicationNotification
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 14 Nov 2001 08:55:54 -0800

On Tuesday, November 13, 2001, at 02:45 PM, Finlay Dobbie wrote:

In a Foundation tool, I have:

[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:controller selector:@selector(foo:) name:NSWorkspaceDidLaunchApplicationNotification object:nil];

[[NSRunLoop currentRunLoop] run];

Where controller is an object that is properly initialised and has the method:
- (void)foo:(NSNotification *)notification {
NSLog(@"Application launched: %@", [[notification userInfo] objectForKey:@"NSApplicationName"]);
}

It runs but foo: never gets called and I don't get any output. Anybody have any idea why? I am linking against AppKit etc etc...

NSWorkspace currently gets its application launch and quit notices from the window server as part of the event stream, so you have to have a connection to the window server for this to work. That means initializing NSApplication, at the very least; I'm not sure how far you have to go toward being an application for this to work.

Douglas Davidson


  • Follow-Ups:
    • Re: NSWorkspaceDidLaunchApplicationNotification
      • From: Finlay Dobbie <email@hidden>
References: 
 >NSWorkspaceDidLaunchApplicationNotification (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Support for split panes?
  • Next by Date: Re: Modifier keys
  • Previous by thread: NSWorkspaceDidLaunchApplicationNotification
  • Next by thread: Re: NSWorkspaceDidLaunchApplicationNotification
  • Index(es):
    • Date
    • Thread