我有这样的代码。
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
另外,我实现了 userNotificationCenter:shouldPresentNotification:。它工作正常。然而。当应用程序的窗口没有获得焦点时,不会调用此委托方法,并且通知始终存在。
有什么帮助吗?