NSWindow 关闭时如何收到通知
我怎样才能注意到 NSWindow 何时应该或将要关闭?我想要像 windowWillClose 这样的东西。不幸的是,NSWindowController 没有像 UIViewController 那样方便的方法。那么这样做的最佳实践是什么?
谢谢
–f
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据
NSWindow
文档,窗口在即将关闭时会发布NSWindowWillCloseNotification
通知。您的控制器可以观察到此通知。According to the
NSWindow
docs, a window will post aNSWindowWillCloseNotification
notification when it is about to close. Your controller can observe this notification.