abhi's logbook

Adventures in coding and coding for adventures.

User Notifications on Mac OS X

If you want to post a notification on Mac OS X’s Notification Center
this is the code that allows you to do it.

NSUserNotification *notification = [[NSUserNotification alloc] init];
[notification setTitle:@"Hello World"];
[notification setInformativeText:@"Hello world message"];
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];