Can a terminal application register for changes with the notification center? (I created a simple cocoa app and I am getting notification with the objective c equivalent for registering notificaitons)
I have a terminal app with which i would like to register some system events (time change events for ex)
code gist
gist.github /anonymous/0baf4bdfda75ca6302fb348cd390e9ee
{append with .com, broke the link as the post was waiting for moderator for very long time}
I am not receiving any notifications in my app.
Questions:
1) Is that the right way to run an empty runloop? (runloop exits immediately if i start with no source)
2) What state the thread should be to receive the notifications? (i used run loop not sure if thats expected way)
3) If I use a CFNotificationCenterGetDistributedCenter the app crashes,
I am new to the mac os programming, any input/suggestion are appreciated.