O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSWindowController — Mac OS X 10.0

Synopsis

This is one of the three classes that makes up Cocoa’s document-based application architecture; the other two classes are NSDocument and NSDocumentController. Instances of NSWindowController are responsible for managing a single window for a document. NSWindowController has a close relationship with windows contained in nib files, which is evident in the initializer initWithWindowNibName:. This initializer will load the window in the nib and take ownership over it. See Chapter 3 for more information on NSWindowController and its role in document-based applications.

image with no caption

@interface NSWindowController : NSResponder <NSCoding>
                                  // Initializers
   - (id)initWithWindow:(NSWindow *)window;
   - (id)initWithWindowNibName:(NSString *)windowNibName;
   - (id)initWithWindowNibName:(NSString *)windowNibName 
                                 owner:(id)owner;
   - (id)initWithWindowNibPath:(NSString *)windowNibPath 
                                 owner:(id)owner;
                                  // Accessor Methods
   - (void)setWindowFrameAutosaveName:(NSString *)name;
   - (NSString *)windowFrameAutosaveName;
   - (void)setWindow:(NSWindow *)window;
   - (NSWindow *)window;
   - (void)setDocumentEdited:(BOOL)dirtyFlag;
   - (void)setShouldCloseDocument:(BOOL)flag;
   - (BOOL)shouldCloseDocument;
   - (void)setDocument:(NSDocument *)document;
   - (id)document;
   - (void)setShouldCascadeWindows:(BOOL)flag;
   - (BOOL)shouldCascadeWindows;
                                  // Instance ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required