Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 26, 2006, 01:55 PM   #1
bermanmk
macrumors newbie
 
Join Date: Feb 2006
Notifications between Carbon and Cocoa

I'm writing a preference pane bundle in cocoa (using the xcode project defaults) and a carbon app that is supposed to communicate with it. However the notifications the cocoa app is posting either don't get sent or the carbon app is not registering correctly as an observer. I've hunted around on the web quite a bit and can't seem to see why this isn't working. The relevant bit in the cocoa panel bundle is :


[[NSNotificationCenter defaultCenter] postNotificationName: @"IMStatusPanelUpdate" object:nil userInfo:nil deliverImmediately:TRUE];

and the call in the carbon application that is supposed to set up the observer is:

center = CFNotificationCenterGetLocalCenter();

CFNotificationCenterAddObserver(center,
NULL,
updateMessages,
CFSTR("IMStatusPanelUpdate"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);


the updateMessages function prototype is copied right out of the example posted in the docs, so I'm assuming that it works. Also I tried adding the file "do_xnc_log" to /var/tmp which is supposed to log notifications, but I don't see anything there. Anyone have any ideas as to what is going wrong or a better way to debug notifications?
bermanmk is offline   0 Reply With Quote
Old Feb 26, 2006, 02:07 PM   #2
csubear
macrumors 6502a
 
csubear's Avatar
 
Join Date: Aug 2003
i've never used the note center for ipc, but i think you should be using the NSDistributedNotificationCenter ?
__________________
(\_/)
(-.-)
(><)o
csubear is offline   0 Reply With Quote
Old Feb 26, 2006, 02:16 PM   #3
bermanmk
Thread Starter
macrumors newbie
 
Join Date: Feb 2006
I've tried it with CFNotificationCenterGetDistributedCenter() as well with a similar lack of effect.
bermanmk is offline   0 Reply With Quote
Old Feb 26, 2006, 02:33 PM   #4
bermanmk
Thread Starter
macrumors newbie
 
Join Date: Feb 2006
oh, I see you meant the NSDistributedNotificationCenter, my bad. That totally worked. Thanks
bermanmk is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Difference between GNUstep and Cocoa? zippyfly Mac Programming 1 Sep 22, 2009 05:43 PM
Confusion between Cocoa and Cocoa Touch. Finding mixed answers online : / chrono1081 iPhone/iPad Programming 4 Jun 30, 2009 12:13 AM
Best way to share a Cocoa object between JNI and Cocoa? foidulus Mac Programming 1 Nov 2, 2008 03:05 PM
what is the cocoa, carbon and xcode? bananacake13 Mac Programming 4 Jan 5, 2007 06:51 AM
Carbon and Cocoa. Your opinions. Soulstorm Mac Programming 38 Aug 22, 2006 06:12 AM


All times are GMT -5. The time now is 12:10 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC