由于 MacOS 10.13 每次我单击NSUserNotification
它调用的关闭按钮时:
- (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
我怎样才能防止这种情况或处理close
vsaction
按钮
要创建通知,我会这样做:
NSUserNotification *notification = [[NSUserNotification alloc] init];
...
[notification setHasActionButton:false];
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:(id)self];
并NSUserNotificationAlertStyle
在.plist
设置为“ alert
”
但现在基本上关闭按钮的反应方式相同actionButton
??