由于MacOS的10.13每次我点击一个NSUserNotification
关闭按钮调用:NSUserNotification收市话费didActivateNotification
- (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
我怎样才能避免这种情况或处理close
VS的action
按钮
要创建的通知我做的:
NSUserNotification *notification = [[NSUserNotification alloc] init];
...
[notification setHasActionButton:false];
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:(id)self];
在
.plist
和NSUserNotificationAlertStyle
被设置为“alert
“
但现在基本上关闭按钮的反应方式与actionButton
相同吗?
什么是财产? – maxisme
https://developer.apple.com/documentation/foundation/nsusernotification?language=objc这里您将获得您可以使用的属性详细信息并编写条件操作。 –