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

Re: NSDistributedNotification names


  • Subject: Re: NSDistributedNotification names
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 24 Mar 2008 07:57:44 -0700

Distributed notifications aren't the same thing as NSNotifications, even though Foundation tries to give them a similar API. Regular notifications aren't available to other processes; a notification has to be explicitly posted as distributed, and few are. Distributed notifications are mostly used internally by the OS, though a few are documented.

- another application has been launched
- another application is being switched to active (for now, i check periodically the active application with NSWorkspace)

I remember reading about a distributed notification for apps switching, but I don't remember where. There may well be a notification for an app being launched, but I don't know what it is.


It's not hard to write a little tool that listens for all distributed notifications (pass 'nil' for the notification name) and echoes them to stdout. That's a good way to snoop for what, if anything, the system sends. (But any of these notifications that aren't documented are subject to change in future releases of the OS.)

- another application opens new window or document window
- another application changes the frontmost window
- another application is performing an open/save action

There's no way to get notified of things like this happening outside your process. In general apps keep their window state private from each other (though it's possible to ask via AppleEvents.)


—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: NSDistributedNotification names
      • From: "A.M." <email@hidden>
References: 
 >NSDistributedNotification names (From: Marco Cassinerio <email@hidden>)
 >Re: NSDistributedNotification names (From: "Sherm Pendley" <email@hidden>)
 >Re: NSDistributedNotification names (From: Marco Cassinerio <email@hidden>)
 >Re: NSDistributedNotification names (From: Nick Zitzmann <email@hidden>)
 >Re: NSDistributedNotification names (From: Marco Cassinerio <email@hidden>)

  • Prev by Date: Re: NSTreeController / CoreData still broken in 10.5?
  • Next by Date: Garbage collection - was Beginner with Cocoa
  • Previous by thread: Re: NSDistributedNotification names
  • Next by thread: Re: NSDistributedNotification names
  • Index(es):
    • Date
    • Thread