1

我现在在做什么:

[[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications];

所以我的问题是,如何在通知中心留下通知?

4

1 回答 1

0

您可以随时删除它,然后再次添加它,确保 NSUserNotificationCenter 委托类将 shouldPresentNotification 方法实现为 NO。

  • (BOOL)userNotificationCenter:(NSUserNotificationCenter*)center shouldPresentNotification:(NSUserNotification*)nsNotification { return NO; }
于 2015-11-30T15:37:39.757 回答