Methods


defaultViewNibName
Returns the name of the nib file containing the view for the receiving class.
init
Designated initializer.
supercontroller
Returns the receiver's supercontroller.
setSupercontroller:
Sets the receiver's supercontroller.
subcontrollers
Returns the receiver's array of subcontrollers.
insertSubcontroller:atIndex:
Inserts the given controller as a subcontroller of the receiver.
addSubcontroller:
Adds the given controller as a subcontroller of the receiver.
removeSubcontrollerAtIndex:
Removes the subcontroller of the receiver at the given index.
removeSubcontroller:
Removes the given subcontroller of the receiver.
controller:didInsertSubcontroller:atIndex:
Called when subcontrollers are inserted into the hierarchy.
controller:willRemoveSubcontroller:atIndex:
Called when subcontrollers are removed from the hierarchy.
isAncestorOfController:
Returns whether the receiver is an ancestor of the given controller.
viewNibName
Returns the name of the nib file that this controller loads.
viewNibPath
Returns the path of the nib file that this controller loads.
isViewLoaded
Returns whether the receiver's view has been loaded (or created).
view
Returns the receiver's base view, loading the content view if necessary.
contentView
Returns the receiver's contentView, loading it if necessary.
setContentView:
Sets the receiver's contentView.
minContentSize
Returns the minimum size for the content view.
setMinContentSize:
Sets the minimum size for the content view.
maxContentSize
Returns the max size for the content view.
setMaxContentSize:
Sets the max size for the content view.
loadView
Loads (or creates) the controller's view.
viewWillLoad
Sent immediately before the receiver loads its view.
viewDidLoad
Sent immediately after the receiver loads its view.
isViewInstalled
Returns whether the controller's view is currently installed in a view hierarchy.
viewWasInstalled
Notifies the controller that its view was installed in a view hierarchy.
viewWillBeUninstalled
Notifies the controller that its view is about to be uninstalled from a view hierarchy.
controllerViewWasInstalled:
Called when a controller's view has been installed.
controllerViewWillBeUninstalled:
Called when a controller's view is about to be uninstalled.
update
Sent to any installed controllers after their window is updated.
firstKeyView
Returns the controller's firstKeyView.
setFirstKeyView:
Sets the controller's firstKeyView.
lastKeyView
Returns the controller's lastKeyView.
setWantsOwnWindow:
Used to give a controller its own window (or take it away).
wantsOwnWindow
Returns whether the controller should own and manage its own window.
loadControllerWindow
Called when the window that the controller will live in needs to be created.
controllerWindowClass
Returns the NSWindow subclass that should be used when the receiver creates its own window.
controllerWindowStyleMask
Returns the NSWindow style mask that should be used when the receiver creates its own window.
windowController
Returns the NSWindowController that manages the window the receiver is in.
showWindow:
Tells the NSWindowController that manages the window the receiver is in to show itself.
setLabel:icon:representedFilename:
Sets the label, icon, and representedFilename of the receiver.
setLabel:
Sets the label of the receiver.
setIcon:
Sets the icon of the receiver.
setRepresentedFilename:
Sets the representedFilename of the receiver.
setLabelAsFilename:
Sets the label, icon, and representedFilename of the receiver.
label
Returns the label of the receiver.
icon
Returns the icon of the receiver.
representedFilename
Returns the representedFilename of the receiver.
controllerDidChangeLabel:
Sent when a controller's label, icon, or representedFilename changes.
stateDictionaryIgnoringContentState:
Returns the state dictionary for the receiver.
takeStateDictionary:ignoringContentState:
Restores the receiver's state from the state dictionary.
savesSubcontrollerState
Returns whether subcontroller state should be saved.
viewControllerWithStateDictionary:ignoringContentState:
Create a controller hierarchy from a saved state dictionary.
setViewControllerClassLoader:
Sets the object to use to load unknown controller classes.
viewControllerClassLoader
Gets the object to use to load unknown controller classes.
activeControllerShowsFocus
Returns whether MOViewController will visibly show a ring around the controller that contains the first responder in its window.
setActiveControllerShowsFocus:
Sets whether MOViewController will visibly show a ring around the controller that contains the first responder in its window.
focusRingColor
Returns the color to use to draw the controller focus ring.
setFocusRingColor:
Sets the color to use to draw the controller focus ring.
focusRingWidth
Returns the width of the line used to draw the controller focus ring.
setFocusRingWidth:
Sets the width of the line used to draw the controller focus ring.
showsControllerFocus
Returns whether this controller should show a focus ring.

activeControllerShowsFocus

Returns whether MOViewController will visibly show a ring around the controller that contains the first responder in its window.
+ ( BOOL ) activeControllerShowsFocus;

Returns whether MOViewController will visibly show a ring around the controller that contains the first responder in its window. The default is NO. If set to YES, then MOViewController will draw a focus ring around the first view controller in the responder chain that returns YES for -showsControllerFocus.

method result
Whether MOViewController will visibly show focus.

addSubcontroller:

Adds the given controller as a subcontroller of the receiver.
- ( void ) addSubcontroller:
        (MOViewController *) subcontroller;

Adds the given controller as a subcontroller of the receiver. This method calls -insertSubcontroller:atIndex: to insert the new controller at the end of the subcontroller array.

Parameter Descriptions
subcontroller
The new subcontroller.

contentView

Returns the receiver's contentView, loading it if necessary.
- ( id ) contentView;

Returns the receiver's contentView, loading it if necessary. Calls to this method should be avoided until it is time to actually install the view into a view hierarchy in order to preserve laziness. Use -isViewLoaded to avoid asking for the view if you do not want it to be loaded.

method result
The receiver's contentView.

controller:didInsertSubcontroller:atIndex:

Called when subcontrollers are inserted into the hierarchy.
- ( void ) controller:
        (MOViewController *) controller didInsertSubcontroller:
        (MOViewController *) subcontroller atIndex:
        (unsigned ) index;

Called when subcontrollers are inserted into the hierarchy. This method is purely for overriding by controller subclasses that need to be aware of changes in the controller hierarchy. Right after a controller has a new subcontroller inserted this method is sent to the controller, to all its ancestors, to the subcontroller and to all the subcontroller's descendants. Overrides should call super. This method should never be called directly.

Parameter Descriptions
controller
The controller that had a new subcontroller inserted.
subcontroller
The subcontroller that was inserted.
index
The index of the subcontroller.

controller:willRemoveSubcontroller:atIndex:

Called when subcontrollers are removed from the hierarchy.
- ( void ) controller:
        (MOViewController *) controller willRemoveSubcontroller:
        (MOViewController *) subcontroller atIndex:
        (unsigned ) index;

Called when subcontrollers are removed from the hierarchy. This method is purely for overriding by controller subclasses that need to be aware of changes in the controller hierarchy. Right before a controller has a subcontroller removed this method is sent to the controller, to all its ancestors, to the subcontroller and to all the subcontroller's descendants. Overrides should call super. This method should never be called directly.

Parameter Descriptions
controller
The controller that had a new subcontroller inserted.
subcontroller
The subcontroller that was inserted.
index
The index of the subcontroller.

controllerDidChangeLabel:

Sent when a controller's label, icon, or representedFilename changes.
- ( void ) controllerDidChangeLabel:
        (MOViewController *) controller;

Sent when a controller's label, icon, or representedFilename changes. This method is sent to the controller and all its ancestors. Overrides should call super. This method should never be called directly.

Parameter Descriptions
controller
The controller whose label changed.

controllerViewWasInstalled:

Called when a controller's view has been installed.
- ( void ) controllerViewWasInstalled:
        (MOViewController *) controller;

Called when a controller's view has been installed. This method is purely for overriding by controller subclasses that need to be aware when views are installed. Right after a controller's view is installed this method is sent to the controller, to all its ancestors, and to all the controller's descendants. Overrides should call super. This method should never be called directly.

Parameter Descriptions
controller
The controller whose view was installed.

controllerViewWillBeUninstalled:

Called when a controller's view is about to be uninstalled.
- ( void ) controllerViewWillBeUninstalled:
        (MOViewController *) controller;

Called when a controller's view is about to be uninstalled. This method is purely for overriding by controller subclasses that need to be aware when views are uninstalled. Right before a controller's view is uninstalled this method is sent to the controller, to all its ancestors, and to all the controller's descendants. Overrides should call super. This method should never be called directly.

Parameter Descriptions
controller
The controller whose view will be uninstalled.

controllerWindowClass

Returns the NSWindow subclass that should be used when the receiver creates its own window.
- ( Class ) controllerWindowClass;

Returns the NSWindow subclass that should be used when the receiver creates its own window. MOViewController's implementation returns [NSWindow class].

method result
The window class.

controllerWindowStyleMask

Returns the NSWindow style mask that should be used when the receiver creates its own window.
- ( unsigned ) controllerWindowStyleMask;

Returns the NSWindow style mask that should be used when the receiver creates its own window. MOViewController's implementation returns (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask).

method result
The window style mask.

defaultViewNibName

Returns the name of the nib file containing the view for the receiving class.
+ ( NSString *) defaultViewNibName;

Returns the name of the nib file containing the view for the receiving class. By default, this returns the name of the class which means that this method does not need to be overridden normally if you name your nib files and classes with the same names.

method result
The name of the nib file.

firstKeyView

Returns the controller's firstKeyView.
- ( id ) firstKeyView;

Returns the controller's firstKeyView. This method will cause the controller's view to be loaded if necessary. Usually the firstKeyView is set via an outlet connection in Interface Builder. For proper functioning, there should be a complete tab-loop defined in the controller's nib file (if there is more than one view that should be able to get focus).

method result
The controller's firstKeyView.

focusRingColor

Returns the color to use to draw the controller focus ring.
+ ( NSColor *) focusRingColor;

Returns the color to use to draw the controller focus ring. If +activeControllerShowsFocus returns YES, then the focus ring will be drawn with the color returned by this method. The default is [NSColor keyboardFocusIndicatorColor].

method result
The color to use to draw the controller focus ring.

focusRingWidth

Returns the width of the line used to draw the controller focus ring.
+ ( float ) focusRingWidth;

Returns the width of the line used to draw the controller focus ring. If +activeControllerShowsFocus returns YES, then the focus ring will be drawn with the width returned by this method. The default is 3.0.

method result
The width of the line used to draw the controller focus ring.

icon

Returns the icon of the receiver.
- ( NSImage *) icon;

Returns the icon of the receiver.

method result
The icon.

init

Designated initializer.
- ( id ) init;

Designated initializer. Note that ALL the inherited initializers from NSWindowController are explicitly disallowed for MOViewController except for -init. This method initializes the controller so that it will load the nib file returned by +defaultViewNibName.

method result
The initialized instance.

insertSubcontroller:atIndex:

Inserts the given controller as a subcontroller of the receiver.
- ( void ) insertSubcontroller:
        (MOViewController *) subcontroller atIndex:
        (unsigned ) index;

Inserts the given controller as a subcontroller of the receiver. This is the primitive method for adding a subcontroller. The controller is inserted at the given index.

Parameter Descriptions
subcontroller
The new subcontroller.
index
The index for insertion.

isAncestorOfController:

Returns whether the receiver is an ancestor of the given controller.
- ( BOOL ) isAncestorOfController:
        (MOViewController *) descendant;

Returns whether the receiver is an ancestor of the given controller.

Parameter Descriptions
descendant
The potential descendant.
method result
Whether the receiver is an ancestor of the given controller.

isViewInstalled

Returns whether the controller's view is currently installed in a view hierarchy.
- ( BOOL ) isViewInstalled;

Returns whether the controller's view is currently installed in a view hierarchy.

method result
(description)

isViewLoaded

Returns whether the receiver's view has been loaded (or created).
- ( BOOL ) isViewLoaded;

Returns whether the receiver's view has been loaded (or created). If the controller has loaded its nib or has had an explicit call to -setContentView: (even -setContentView:nil), this will reutrn YES. This is often used to avoid asking questions or to postpone work that would cause the view to be loaded in order to keep nib file loading as lazy as possible.

method result
Whether the receiver's view has been loaded (or created).

label

Returns the label of the receiver.
- ( NSString *) label;

Returns the label of the receiver. If the label has never been set, MOViewController returns the class' name by default.

method result
The label.

lastKeyView

Returns the controller's lastKeyView.
- ( id ) lastKeyView;

Returns the controller's lastKeyView. This method will cause the controller's view to be loaded if necessary. This method returns the firstKeyView's previousKeyView or the firstKeyView if it has no previousKeyView. This property is not directly settable. Instead it is calculated from the firstKeyView at the time it is set (or after the controller's nib has loaded).


loadControllerWindow

Called when the window that the controller will live in needs to be created.
- ( NSWindow *) loadControllerWindow;

Called when the window that the controller will live in needs to be created. When a controller is set to have its own window, this method is called when that window actually needs to be created. MOViewController's implementation allocates a new window of the class returned by -controllerWindowClass with the style mask returned by -controllerWindowStyleMask.

method result
The window that the controller should live in.

loadView

Loads (or creates) the controller's view.
- ( void ) loadView;

Loads (or creates) the controller's view. MOViewController's implementation attempts to load the controller's nib file. Subclasses may override if they create their view programmatically instead of through loading a nib. In this case, the override should create the view and call -setContentView: to give ownership of it to the controller. This method should never be called directly.


maxContentSize

Returns the max size for the content view.
- ( NSSize ) maxContentSize;

Returns the max size for the content view.


minContentSize

Returns the minimum size for the content view.
- ( NSSize ) minContentSize;

Returns the minimum size for the content view. If the containing view (or window) is smaller than the content view's minimum size, the content view will clip on the right/lower edges


removeSubcontroller:

Removes the given subcontroller of the receiver.
- ( void ) removeSubcontroller:
        (MOViewController *) subcontroller;

Removes the given subcontroller of the receiver. This method calls -removeSubcontrollerAtIndex: after finding the index for the given subcontroller.

Parameter Descriptions
subcontroller
The subcontroller to be removed.

removeSubcontrollerAtIndex:

Removes the subcontroller of the receiver at the given index.
- ( void ) removeSubcontrollerAtIndex:
        (unsigned ) index;

Removes the subcontroller of the receiver at the given index. This is the primitive method for removing a subcontroller.

Parameter Descriptions
index
The index of the subcontroller to be removed.

representedFilename

Returns the representedFilename of the receiver.
- ( NSString *) representedFilename;

Returns the representedFilename of the receiver.

method result
The representedFilename.

savesSubcontrollerState

Returns whether subcontroller state should be saved.
- ( BOOL ) savesSubcontrollerState;

Returns whether subcontroller state should be saved. This controls whether -stateDictionaryIgnoringContentState: will generate configuration state for subcontrollers. It also controls whether -takeStateDictionary:ignoringContentState: will attempt to restore state for subcontrollers if it exists in the dictionaries they are given. The default is YES.

method result
Whether subcontroller state should be saved.

setActiveControllerShowsFocus:

Sets whether MOViewController will visibly show a ring around the controller that contains the first responder in its window.
+ ( void ) setActiveControllerShowsFocus:
        (BOOL ) flag;

Sets whether MOViewController will visibly show a ring around the controller that contains the first responder in its window. The default is NO. If set to YES, then MOViewController will draw a focus ring around the first view controller in the responder chain that returns YES for -showsControllerFocus.

Parameter Descriptions
flag
Whether MOViewController will visibly show focus.

setContentView:

Sets the receiver's contentView.
- ( void ) setContentView:
        (NSView *) aView;

Sets the receiver's contentView. There is one common direct use of this method: it is often called from the -loadView of a subclass that programmatically constructs its view instead of loading it from a nib file. This method is called implicitly when loading the nib file of a controller to estabnlish the view outlet connection. It is rare to need to override this method and it is rare to call it directly other than from an override of -loadView.

Parameter Descriptions
aView
The contentView.

setFirstKeyView:

Sets the controller's firstKeyView.
- ( void ) setFirstKeyView:
        (id ) aFirstKeyView;

Sets the controller's firstKeyView. Usually this is called during nib loading to connect the outlet. The firstKeyView should be a view within the controller's owned view hierarchy. It is not directly retained by the controller. At the time this method is called, the given firstKeyView should already be a member of a complete tab-loop (or, if there's only one interesting view, it should have no nextKeyView). The controller's lastKeyView will be calculated when this method is called (actually, because there's no order guarantee of any order for IB outlet conenctions, the lastKeyView will also be computed at -viewDidLoad time). The firstKeyView MUST be set prior to the controller's view ever being installed. Practically speaking this means that it should be set through an outlet connection in Interface Builder or in a subclasses' override of -loadView for subclasses that programmatically create their views.


setFocusRingColor:

Sets the color to use to draw the controller focus ring.
+ ( void ) setFocusRingColor:
        (NSColor *) color;

Sets the color to use to draw the controller focus ring. If +activeControllerShowsFocus returns YES, then the focus ring will be drawn with the color set through this method. The default is [NSColor keyboardFocusIndicatorColor].

Parameter Descriptions
color
The color to use to draw the controller focus ring.

setFocusRingWidth:

Sets the width of the line used to draw the controller focus ring.
+ ( void ) setFocusRingWidth:
        (float ) width;

Sets the width of the line used to draw the controller focus ring. If +activeControllerShowsFocus returns YES, then the focus ring will be drawn with the width set through this method. The default is 3.0.

Parameter Descriptions
width
The width of the line used to draw the controller focus ring.

setIcon:

Sets the icon of the receiver.
- ( void ) setIcon:
        (NSImage *) label;

Sets the icon of the receiver. The preserves the existing label and representedFilename.

Parameter Descriptions
icon
The icon, may be nil.

setLabel:

Sets the label of the receiver.
- ( void ) setLabel:
        (NSString *) label;

Sets the label of the receiver. The clears the existing representedFilename. It preserves any existing icon.

Parameter Descriptions
label
The label, this must be non-nil.

setLabel:icon:representedFilename:

Sets the label, icon, and representedFilename of the receiver.
- ( void ) setLabel:
        (NSString *) label icon:
        (NSImage *) icon representedFilename:
        (NSString *) path;

Sets the label, icon, and representedFilename of the receiver. This is the primitive method for setting the label, icon, and representedFilename. The other related set methods simply call this one.

Parameter Descriptions
label
The label, this must be non-nil.
icon
The icon, may be nil.
path
The representedFilename, may be nil.

setLabelAsFilename:

Sets the label, icon, and representedFilename of the receiver.
- ( void ) setLabelAsFilename:
        (NSString *) path;

Sets the label, icon, and representedFilename of the receiver. The label and icon are calculated from the given representedFilename.

Parameter Descriptions
path
The representedFilename, may be nil.

setMaxContentSize:

Sets the max size for the content view.
- ( void ) setMaxContentSize:
        (NSSize ) maxContentSize;

Sets the max size for the content view.


setMinContentSize:

Sets the minimum size for the content view.
- ( void ) setMinContentSize:
        (NSSize ) minContentSize;

Sets the minimum size for the content view. If the containing view (or window) is smaller than the content view's minimum size, the content view will clip on the right/lower edges


setRepresentedFilename:

Sets the representedFilename of the receiver.
- ( void ) setRepresentedFilename:
        (NSString *) path;

Sets the representedFilename of the receiver. The preserves the existing label and icon.

Parameter Descriptions
path
The representedFilename, may be nil.

setSupercontroller:

Sets the receiver's supercontroller.
- ( void ) setSupercontroller:
        (MOViewController *) supercontroller;

Sets the receiver's supercontroller. This method is invoked automatically when a controller is added to or removed from its supercontroller. Overrides should call super. This method should never be called directly.

Parameter Descriptions
supercontroller
The new supercontroller.

setViewControllerClassLoader:

Sets the object to use to load unknown controller classes.
+ ( void ) setViewControllerClassLoader:
        (id ) classLoader;

Sets the object to use to load unknown controller classes. +viewControllerWithStateDictionary:ignoringContentState: will send this object a -viewControllerClassFromString: message whenever it encounters a controller class name in a state dictionary. The object may do whatever it needs to do to locate and load the code for the requested class. It can even return a different class, but doing so is potentially dangerous unless the substitution is part of an overall design.

Similarly, -stateDictionaryIgnoringContentState: will call -stringFromViewControllerClass: for each controller being saved to get the name to use within the state dictionary.

If no MOViewControllerClassLoader is set then MOViewController will use NSClassFromString() and NSStringFromClass() to map classes back and forth from their names.

Parameter Descriptions
classLoader
The object to use to resolve controller class names.

setWantsOwnWindow:

Used to give a controller its own window (or take it away).
- ( void ) setWantsOwnWindow:
        (BOOL ) flag;

Used to give a controller its own window (or take it away). If the flkag is YES then the receiver will be a top-level controller that owns and manages its own window. If the flag is NO, the controller will not have its own window (and will generally be inserted as a subcontroller within a larger controller hierarchy.)

Parameter Descriptions
flag
Whether the controller should own and manage its own window.

showWindow:

Tells the NSWindowController that manages the window the receiver is in to show itself.
- ( void ) showWindow:
        (id ) sender;

Tells the NSWindowController that manages the window the receiver is in to show itself. If the receiver owns its own window then this sends -showWindow: to the NSWindowController it uses to manage it. Otherwise it sends [[self supercontroller] showWindow:sender].

Parameter Descriptions
sender
Action sender, ignored.

showsControllerFocus

Returns whether this controller should show a focus ring.
- ( BOOL ) showsControllerFocus;

Returns whether this controller should show a focus ring. When +activeControllerShowsFocus is set to YES, this method is called to see if any particular controller should or should not show a focus ring. The default is YES. If this is overridden to return NO, then the focus ring will be drawn around this controller's supercontroller (if it returns YES for -showsControllerFocus... otherwise its supercontroller, and so on). This is provided as an override point for controller classes that may not want to ever be drawn with a focus ring, preferring instead to let their supercontrollers reflect focus

method result
Whether this controller should show a focus ring.

stateDictionaryIgnoringContentState:

Returns the state dictionary for the receiver.
- ( NSMutableDictionary *) 
    stateDictionaryIgnoringContentState:
    (BOOL ) ignoreContentFlag;

Returns the state dictionary for the receiver. MOViewController saves its view's frame and, if [self savesSubcontrollerState] is YES, it recursively saves info about all its subcontrollers. Subclasses may override this method to store their own additional state. The ignoreContentFlag argument indicates whether state that relies on the current content of the controller should be saved. Non-content state should be limited to state that does not depend on the data being displayed. Content state can be used to store state that depends on the data being displayed. For example, if a controller contains an outline that always shows three columns and shows data from a document, the column order and sizes are non-content state, but the expansion state of the outline contents and the selected items should be considered content state. On the other hand, if the outline always shows the same hierarchy, then the expansion state could be considered non-content state. Sometimes generic controller subclasses may need to provide API to allow clients to decide whether a particular piece of information is content state or not based on how they are used. See MOTabViewController for an example of this.

Subclasses should always call super. Subclasses should take care not to cause view loading when overriding this method. If the view has not been loaded, this method should not cause it to be loaded simply to gather and return the (default) geometry configuration.

Parameter Descriptions
ignoreContentFlag
If this is YES then any content-specific state should not be added to the result dictionary.
method result
The state dictionary for the receiver.

subcontrollers

Returns the receiver's array of subcontrollers.
- ( NSArray *) subcontrollers;

Returns the receiver's array of subcontrollers.

method result
The receiver's array of subcontrollers.

supercontroller

Returns the receiver's supercontroller.
- ( id ) supercontroller;

Returns the receiver's supercontroller.

method result
The receiver's supercontroller.

takeStateDictionary:ignoringContentState:

Restores the receiver's state from the state dictionary.
- ( void ) takeStateDictionary:
        (NSDictionary *) dict ignoringContentState:
        (BOOL ) ignoreContentFlag;

Restores the receiver's state from the state dictionary. MOViewController restores its view's frame and, if [self savesSubcontrollerState] is YES, it recursively restores info for all its subcontrollers. Subclasses may override this method to restore their own additional state. The ignoreContentFlag argument indicates whether state that relies on the current content of the controller should be restored. Non-content state should be limited to state that does not depend on the data being displayed. Content state can be used to store state that depends on the data being displayed. For example, if a controller contains an outline that always shows three columns and shows data from a document, the column order and sizes are non-content state, but the expansion state of the outline contents and the selected items should be considered content state. On the other hand, if the outline always shows the same hierarchy, then the expansion state could be considered non-content state. Sometimes generic controller subclasses may need to provide API to allow clients to decide whether a particular piece of information is content state or not based on how they are used. See MOTabViewController for an example of this.

Subclasses should always call super. Subclasses should take care not to cause view loading when overriding this method. In some cases this may require storing away some of the information until the view loads and it can be applied.

Parameter Descriptions
dict
The state dictionary to be restored.
ignoreContentFlag
If this is YES then any content-specific state in the dictionary should be ignored.

update

Sent to any installed controllers after their window is updated.
- ( void ) update;

Sent to any installed controllers after their window is updated. This method is automatically invoked on any controllers that are currently (fully) installed at the end of each event loop. View controllers are updated immediately following the -update of the window that contains them. "Fully" installed means that the controller must be installed in its supercontroller and its supercontroller and all its ancestor controllers must also be installed. It is also required that the top-level ancestor controller owns the window that contains the controller (in the -setWantsOwnWindow:YES sense).

Note that -update is not responsible for recursing and sending update messages to the receiver's subcontrollers. This is handled elsewhere. If you invoke -update directly it will update the receiver only, not its subcontrollers.


view

Returns the receiver's base view, loading the content view if necessary.
- ( id ) view;

Returns the receiver's base view, loading the content view if necessary. Calls to this method should be avoided until it is time to actually install the view into a view hierarchy in order to preserve laziness. Use -isViewLoaded to avoid asking for the view if you do not want it to be loaded.

method result
The receiver's view.

viewControllerClassLoader

Gets the object to use to load unknown controller classes.
+ ( id ) 
    viewControllerClassLoader;

Gets the object to use to load unknown controller classes. +viewControllerWithStateDictionary:ignoringContentState: will send this object a -viewControllerClassFromString: message whenever it encounters a controller class name in a state dictionary. The object may do whatever it needs to do to locate and load the code for the requested class. It can even return a different class, but doing so is potentially dangerous unless the substitution is part of an overall design.

Similarly, -stateDictionaryIgnoringContentState: will call -stringFromViewControllerClass: for each controller being saved to get the name to use within the state dictionary.

If no MOViewControllerClassLoader is set then MOViewController will use NSClassFromString() and NSStringFromClass() to map classes back and forth from their names.

method result
The object to use to resolve controller class names.

viewControllerWithStateDictionary:ignoringContentState:

Create a controller hierarchy from a saved state dictionary.
+ ( id ) viewControllerWithStateDictionary:
        (NSDictionary *) dict ignoringContentState:
        (BOOL ) ignoreContentFlag;

Create a controller hierarchy from a saved state dictionary. This method uses the information in the given state dictionary to recreate a controller hierarchy. Contrast this with -takeStateDictionary:ignoringContentState: which applies a state dictionary to an existing controller hierarchy. Actually, this method first builds the controller hierarchy, given the information in the state dictionary, and then simply calls -takeStateDictionary:ignoringContentState: on the root controller of the hierarchy it has created.

If no MOViewControllerClassLoader has been set, then this method will use NSClassFromString to locate the classes to use for each controller in the dictionary. If there is a MOViewControllerClassLoader, then it will be asked to resolve controller class names into classes.

Parameter Descriptions
dict
The state dictionary.
ignoreContentFlag
If this is YES then any content-specific state in the dictionary should be ignored.
method result
The newly constructed top-level controller.

viewDidLoad

Sent immediately after the receiver loads its view.
- ( void ) viewDidLoad;

Sent immediately after the receiver loads its view. Subclasses may override to finish setting up after the view is loaded. Overrides should call super. This method should never be called directly.


viewNibName

Returns the name of the nib file that this controller loads.
- ( NSString *) viewNibName;

Returns the name of the nib file that this controller loads. This is basically a rename of the inherited -windowNibName (and -windowNibName will also return the same name).

method result
The nib file name.

viewNibPath

Returns the path of the nib file that this controller loads.
- ( NSString *) viewNibPath;

Returns the path of the nib file that this controller loads. This is basically a rename of the inherited -windowNibPath (and -windowNibPath will also return the same name).

method result
The nib file path.

viewWasInstalled

Notifies the controller that its view was installed in a view hierarchy.
- ( void ) viewWasInstalled;

Notifies the controller that its view was installed in a view hierarchy. This method MUST be sent to the controller AFTER its view has been installed. Usually it is the controller's supercontroller that installs the view and then sends this message. This method should not be overridden. Instead, override the -controllerViewWasInstalled: method if you need to do anything when your controller's view has been installed.


viewWillBeUninstalled

Notifies the controller that its view is about to be uninstalled from a view hierarchy.
- ( void ) viewWillBeUninstalled;

Notifies the controller that its view is about to be uninstalled from a view hierarchy. This method MUST be sent to the controller BEFORE its view has been uninstalled. Usually it is the controller's supercontroller that sends this message and then uninstalls the view. This method should not be overridden. Instead, override the -controllerViewWillBeUninstalled: method if you need to do anything when your controller's view is about to be uninstalled.


viewWillLoad

Sent immediately before the receiver loads its view.
- ( void ) viewWillLoad;

Sent immediately before the receiver loads its view. Subclasses may override to prepare for the view to be loaded. Overrides should call super. This method should never be called directly.


wantsOwnWindow

Returns whether the controller should own and manage its own window.
- ( BOOL ) wantsOwnWindow;

Returns whether the controller should own and manage its own window.

method result
Whether the controller should own and manage its own window.

windowController

Returns the NSWindowController that manages the window the receiver is in.
- ( NSWindowController *) windowController;

Returns the NSWindowController that manages the window the receiver is in. If the receiver owns its own window then this returns the NSWindowController it uses to manage it. Otherwise it returns [[self supercontroller] windowController].

method result
The window controller.

(Last Updated 3/20/2005)