多窗口可可应用程序
如果应用程序中有多个窗口,如何在它们之间传递值?
我的第一个方法是为任何窗口创建一个 NSWindowController,并将这些控制器分配给应用程序委托。
我走的路正确吗?你有什么建议?
If there are multiple window in an application how do I pass values between them?
My first approach would be to create a NSWindowController for any window, and assign these controllers to the Application Delegate.
Am I on the right way? What do you suggest?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你的技术很好。如果您正在创建基于文档的应用程序,您也可以在 NSDocument 子类中执行此操作。
Yes, your technique is fine. If you are creating a document-based application you can also do this in your NSDocument subclass.