views:

40

answers:

2

When reading Apple's Cocoa tutorial, the window controller is just a regular class and while understand that this is perfectly fine I suppose, wouldn't it be better to subclass NSWindowController?

If I get this right, NSWindowController is a convenience class which already has a lot of the functionality required by a window controller implemented, right?

Is there any reason why you would not use this class?

A: 

You are totally free to use a NSWindowController subclass or even without subclassing it, in fact it is encouraged. Notice that NSDocument is a subclass of NSWindowController and also it commonly used for stuff like showing preferences windows and whatnot.

Alej
A: 

You don't have to. I've sometimes implemented controllers for a window that inherited from NSObject, if I didn't really need the added functionality of NSWindowController.

mipadi