Cocoa Close/Hide/Change Tab Notification

ぃ、小莉子 提交于 2019-12-13 03:53:39

问题


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?


回答1:


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/



来源:https://stackoverflow.com/questions/9826719/cocoa-close-hide-change-tab-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!