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

NSDistributedNotificationCenter


  • Subject: NSDistributedNotificationCenter
  • From: randy chapel <email@hidden>
  • Date: Tue, 14 Oct 2008 09:05:38 -0700 (PDT)

Hi,

Has anyone had any luck using a NSDistributedNotificationCenter in a prefpane?

code:

in using the pref pane example from apple (http://developer.apple.com/samplecode/PrefsPane/index.html), I used the following code in the mainViewDidLoad method.

NSDistributedNotificationCenter *center =
[NSDistributedNotificationCenter defaultCenter];
[center addObserver: self
selector: @selector(callbackWithNotification:)
name: @"My Notification"
object: nil];


- (void)callbackWithNotification:(NSNotification *)myNotification {
[[NSSound soundNamed:@"pop"] play]; // yet it worked
}





with a notification in another app written as:

NSDistributedNotificationCenter *center =
[NSDistributedNotificationCenter defaultCenter];
[center postNotificationName: @"My Notification"
object: nil
userInfo: nil /* no dictionary */
deliverImmediately: YES];



Of interest, I need to communicate back and forth.  Nothing is working either sending from the pref pane or receiving to it (at least in what I have tried).  (see http://developer.apple.com/documentation/UserExperience/Conceptual/PreferencePanes/PreferencePanes.pdf)


Has anyone else had luck with such?  what am I missing?

Randy








_______________________________________________

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

  • Prev by Date: NSTask not cleaning up it's threads
  • Next by Date: NSDistributedNotificationCenter in a prefpane?
  • Previous by thread: Re: NSTask not cleaning up it's threads
  • Next by thread: NSDistributedNotificationCenter in a prefpane?
  • Index(es):
    • Date
    • Thread