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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to