如何使用NSWindowController? [英] How to use NSWindowController?

查看:269
本文介绍了如何使用NSWindowController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 NSWindowController ,我只是不能想到如何让它工作。如何开始使用它?

I'm looking in to using NSWindowController and I just can't think how to get it working. How do I start using it?

推荐答案

很难回答这个问题而不知道你想要做什么。但是,如果您正在编写基于文档的应用程序,则会为您创建的每个窗口自动创建一个NSWindowController,因此您不需要特别创建。

It's difficult to answer this question without knowing what you're trying to do. However, if you are writing a document-based application, an NSWindowController is automatically created for each window you create, so you don't need to create one specially.

方式我使用NSWindowController是我为我的应用程序中的每种类型的窗口创建不同的子类。例如,我可能有一个3D应用程序与AppWireframeWindowController和AppPreviewWindowController。每个子类自动加载正确的nib文件,并有代码将文档的数据挂钩到nib中的视图。

The way I use NSWindowController is I create a different subclass for each type of window in my application. For example, I might have a 3D application with an AppWireframeWindowController and an AppPreviewWindowController. Each subclass automatically loads the correct nib file, and has code that hooks the document's data to the views in the nib.

这篇关于如何使用NSWindowController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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