I’m still quite new to this but I’ve been learning really quickly with the help of examples. I’m currently looking into posting notifications from one running program to another, and CFNotificationCenter is the way forward. The only problem is, I can’t work out to use it and there don’t seem to be any examples except for apple’s videoviewer.
Would anybody be able to supply a mini example on how to set it up so I can write one application to post the notification, and one to receive the test notification and doSomething();? Any help is greatly appreciated!
Alright, I wrote up a little example of CFNotificationCenter. Generally, nobody uses CoreFoundation for large projects, and instead use Foundation. If you are really writing this project in Objective-C (as I assume from your tags), I would suggest using NSNotificationCenter. Without further adue, here is the example:
This example creates an observer, posts a simple dictionary to it, and removes the observer. More information on CFNotificationCenter can be found on Apple’s CFNotificationCenter Reference.