How to get notified when NSWindow closes

天大地大妈咪最大 提交于 2019-12-22 02:20:26

问题


how can I take notice when an NSWindow should or will get closed? I'd like to have something like the windowWillClose. Unfortunately NSWindowController does not have as much convenient methods as UIViewController has, for example. So what's the best practice to do that?

Thanks
–f


回答1:


According to the NSWindow docs, a window will post a NSWindowWillCloseNotification notification when it is about to close. Your controller can observe this notification.



来源:https://stackoverflow.com/questions/4286150/how-to-get-notified-when-nswindow-closes

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