cocoaosx-mountain-lionnsusernotification

NSUserNotification not showing action button


I'm using this code:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    NSUserNotification *notification = [[NSUserNotification alloc] init];
    [notification setTitle: @"Title"];
    [notification setSubtitle: @"Subtitle"];
    [notification setInformativeText: @"Informative Text"];

    [notification setHasActionButton: YES];
    [notification setActionButtonTitle: @"Action Button"];
    [notification setOtherButtonTitle: @"Other Button"];

    [notification setSoundName: NSUserNotificationDefaultSoundName];

    [notification setDeliveryDate: [NSDate dateWithTimeIntervalSinceNow: 10]];
    [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification: notification];
}

And I'm getting, without fail,

enter image description here

No action button, or other button.


Solution

  • And here was the answer.

    Thanks again to #macdev on freenode.

    enter image description here

    The selection needs to be "Alerts" to have buttons.