views:

410

answers:

1

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

+1  A: 

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

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.

Dietrich Epp
No, an NSWindowController is not automatically created for each window you create. It is automatically created for each *document*, but if you directly create a window, or load a nib with a window in it, neither action will create a window controller.
Peter Hosey
Is NSWindowController used with using NSDocument?
nanochrome