Is there any example for showing a hello world notification on Mountain Lion OSX 10.8 (the new notification center).
Just to add visual clarity here is what I am talking about:
I finally found answer after a little help from @Alexsander.
NSUserNotification *notification = [[NSUserNotification alloc] init];
[notification setTitle:@"Hello World"];
[notification setInformativeText:@"Hello world message"];
[notification setDeliveryDate:[NSDate dateWithTimeInterval:20 sinceDate:[NSDate date]]];
[notification setSoundName:NSUserNotificationDefaultSoundName];
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];
[center scheduleNotification:notification];
Hope it helps people
Look up NSUserNotification
and NSUserNotificationCenter
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With