renaultssoftware
12-31-2010, 11:29 AM
Hey guys, I have a certain conundrum to figure out here.
I'm writing a 'service' app of sorts. Basically, it subscribes to [[NSWorkspace sharedWorkspace] notificationCenter] to monitor events. The problem is, I can't figure out how to make it subscribe to certain notifications, efficiently.
The idea I've had so far is to use the AppDelegate's applicationDidFinishLaunching: message to set it up. I'd have an array of strings in [NSUserDefaults standardUserDefaults] that represent desired notifications. I'd let a helper object (NotificationHandler) that's part of AppDelegate be subscribed to these notifications. Here I'm having trouble figuring out how to add methods to the NotificationHandler and how to subscribe.
Any ideas?
Thanks in advance!
I'm writing a 'service' app of sorts. Basically, it subscribes to [[NSWorkspace sharedWorkspace] notificationCenter] to monitor events. The problem is, I can't figure out how to make it subscribe to certain notifications, efficiently.
The idea I've had so far is to use the AppDelegate's applicationDidFinishLaunching: message to set it up. I'd have an array of strings in [NSUserDefaults standardUserDefaults] that represent desired notifications. I'd let a helper object (NotificationHandler) that's part of AppDelegate be subscribed to these notifications. Here I'm having trouble figuring out how to add methods to the NotificationHandler and how to subscribe.
Any ideas?
Thanks in advance!