NSDistributedNotificationCenter
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