gpt4 book ai didi

xcode - 始终显示 NSUserNotification

转载 作者:行者123 更新时间:2023-12-04 18:24:10 25 4
gpt4 key购买 nike

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

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

最佳答案

这是 answer提供您需要的信息。

Notifications will only be displayed when your application isn't the key application. If you want your notifications to display regardless of if your application is key or not, you'll need to specify a delegate for NSUserNotificationCenter and override the delegate method userNotificationCenter:shouldPresentNotification: so that it returns YES.

关于xcode - 始终显示 NSUserNotification,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16114388/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com