Depuis Mac OS 10.13 chaque fois que je clique sur le bouton de fermeture sur une NSUserNotification
appelle:NSUserNotification proximité appelle didActivateNotification
- (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
Comment puis-je empêcher cela ou gérer le close
vs le bouton action
Pour créer la notification Je fais:
NSUserNotification *notification = [[NSUserNotification alloc] init];
...
[notification setHasActionButton:false];
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:(id)self];
et NSUserNotificationAlertStyle
dans le .plist
est réglé sur "0 Mais maintenant, le bouton de fermeture réagit de la même manière que le actionButton
?
Quelle est la propriété? – maxisme
https://developer.apple.com/documentation/foundation/nsusernotification?language=objcci vous obtiendrez les informations sur les propriétés que vous pouvez utiliser pour écrire l'action conditionnelle. –