- (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
나는이 문제를 방지하거나 알림을 만들려면 action
버튼
를 대 close
을 처리 할 수있는 방법 내가 수행합니다 .plist
에
NSUserNotification *notification = [[NSUserNotification alloc] init];
...
[notification setHasActionButton:false];
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:(id)self];
및 NSUserNotificationAlertStyle
0 "으로 설정"
하지만 이제 기본적으로 닫기 버튼은 actionButton
과 같은 방식으로 반응합니다.
속성은 무엇입니까? – maxisme
https://developer.apple.com/documentation/foundation/nsusernotification?language=objc 여기에서 사용할 수있는 조건 세부 정보를 얻고 조건부 조치를 작성합니다. –