Mac Mountain Lion send notification from CLI app
问题 How can I send a notification to the notification center from a command line app? My attemps so far compile and run, but don't succeed in notifying me. Example #import <Cocoa/Cocoa.h> int main(int argc, const char * argv[]) { NSLog(@"Running notifications"); NSUserNotification *note = [[NSUserNotification alloc] init]; [note setTitle:@"Test"]; [note setInformativeText:@"Woot"]; NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter]; [center