Instance Method


Invokes shouldCloseSelector with the result of canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: if the specified window controller that is closing is the last one or is marked as causing the document to close.


- (void)shouldCloseWindowController:(NSWindowController *)windowController delegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void *)contextInfo;



The window controller that is closed.


The delegate to which the selector message is sent.


The selector of the message sent to the delegate.


Object passed with the callback to provide any additional context information.


Otherwise it invokes shouldCloseSelector with YES. This method is called automatically by NSWindow for any window that has a window controller and a document associated with it. NSWindow calls this method prior to sending its delegate the windowShouldClose: message. Pass the contextInfo object with the callback.

The shouldCloseSelector callback method should have the following signature:

- (void)document:(NSDocument *)document shouldClose:(BOOL)shouldClose  contextInfo:(void  *)contextInfo

See Also

Creating and Managing Window Controllers

- makeWindowControllers

Subclasses may override this method to create the initial window controller(s) for the document.


The name of the document’s sole nib file.

- windowControllerDidLoadNib:

Sent after the specified window controller loads a nib file if the receiver is the nib file’s owner.

- windowControllerWillLoadNib:

Sent before the specified window controller loads a nib file if the receiver is the nib file’s owner.


The document’s current window controllers.

- addWindowController:

Adds the specified window controller to this document’s list of attached window controllers and sets the document of the passed-in window controller.

- removeWindowController:

Removes the specified window controller from the receiver’s array of window controllers.