Cocoa关闭/隐藏/更改选项卡通知 [英] Cocoa Close/Hide/Change Tab Notification

查看:141
本文介绍了Cocoa关闭/隐藏/更改选项卡通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以检测可可窗口何时关闭,隐藏和/或用户更改了之前的标签页。

解决方案

您可以使用通知在整个应用程序中广播此类信息:



NSNotificationCenter类参考



你可以找到一些好的信息&



这里的一个这里是一个很好的教程: http://cocoawithlove.com/2008/06/five-approaches-to-listening-observing.html p>

一个absolut基本教程示例可以在这里找到: http://agilewarrior.wordpress.com/2012/02/09/dead-simple-nsnotification-example-iphone/


is there any way to detect when a cocoa window has been closed, hidden and/or the user has changed the tab on which he was before?

解决方案

you could use notifications to broadcast such information throughout your application:

NSNotificationCenter Class Reference

you can find some good information & examples in the iTunes U podcasts of brad larson.

this one here is a pretty great tutorial as well: http://cocoawithlove.com/2008/06/five-approaches-to-listening-observing.html

an absolut basic tutorial example can be found here: http://agilewarrior.wordpress.com/2012/02/09/dead-simple-nsnotification-example-iphone/

这篇关于Cocoa关闭/隐藏/更改选项卡通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆