【问题标题】:Always Show the NSUserNotification始终显示 NSUserNotification
【发布时间】:2013-04-19 22:27:24
【问题描述】:

我的NSUserNotification 会在我的应用程序中发生某些事情时显示以记录下来。即使应用程序是最前面的应用程序(即始终显示它),是否有任何方法可以显示通知?

(如果我在其他应用程序中,它确实会显示)

【问题讨论】:

    标签: xcode osx-mountain-lion nsusernotification


    【解决方案1】:

    这里有一个answer,其中包含您需要的信息。

    仅当您的应用程序不是关键应用程序时才会显示通知。如果您希望无论您的应用程序是否为 key 都显示通知,您需要为 NSUserNotificationCenter 指定一个委托并覆盖委托方法 userNotificationCenter:shouldPresentNotification: 以便它返回 YES.

    【讨论】:

      猜你喜欢
      • 2012-07-25
      • 1970-01-01
      • 1970-01-01
      • 2012-12-12
      • 2016-02-11
      • 1970-01-01
      • 2017-01-08
      • 1970-01-01
      • 2013-10-19
      相关资源
      最近更新 更多