This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I also found that you can do: | |
//To register for change events: | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleWhateverChange) name:@"whateverChange" object:nil]; | |
//To fire them. I might be a N00b but I just couldn't get the observer for key path thing to work for me. | |
[[NSNotificationCenter defaultCenter] postNotificationName:@"whateverChange" object:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |