The user notification center reserves the right to decIDe if a
delivered user
notification is presented to the user. For example,it may suppress the
notification if the application is already frontmost (the delegate can overrIDe
this action).
从我可以收集的内容来看,它与userNotificationCenter:shouldPresentNotification:NSUserNotificationCenterDelegate协议参考中显示的方法有关,但我无法弄清楚如何实现它.我已经将我的课程设置为NSUserNotificationCenterDelegate,所以不是这样.
有任何想法吗?
编辑:
在我设置为NSUserNotificationCenterDelegate的类中,我使用它来尝试覆盖原始方法,如果应用程序位于最前面,则默认为NO:
- (BOol)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification {return YES;}
但没有任何反应.
解决方法 NSUserNotificationCenter * center = [NSUserNotificationCenter defaultUserNotificationCenter];[中心时间表通知:通知];
center.delegate = self;
>(BOol)userNotificationCenter 总结
以上是内存溢出为你收集整理的Cocoa:在app最前面强制NSUserNotification全部内容,希望文章能够帮你解决Cocoa:在app最前面强制NSUserNotification所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)