Next Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

NSController

Inherits from
Implements
Package
com.apple.cocoa.application
Availability
Available in Mac OS X v10.3 and later.
Companion guide

Overview

NSController is an abstract class that implements the base functionality required by the Controller Layer.

Tasks

Constructors

Managing Editing

Binding

Constructors

NSController

Creates and returns an empty NSController.

public NSController()

Availability

Instance Methods

bind

Creates a relationship between the receiver’s binding and the property of observableController specified by keyPath.

public void bind(String binding, Object observableController, String keyPath, NSDictionary options)

Discussion

The binding is the key path for a property of the receiver previously exposed. The options dictionary is optional. If present, it contains placeholder objects or an NSValueTransformer identifier as described in “Constants.”

Availability

commitEditing

Causes the receiver to attempt to commit any pending edits, returning true if successful or no edits where pending.

public boolean commitEditing()

Discussion

A commit is denied if the receiver fails to apply the changes to the model object, perhaps due to a validation error.

Availability
See Also

discardEditing

Discards any pending changes by registered editors.

public void discardEditing()

Availability
See Also

isEditing

public boolean isEditing()

Returns true if there are any editors currently registered with the receiver, false otherwise.

- (BOOL)isEditing

Availability

objectDidBeginEditing

Invoked to inform the receiver that editor has uncommitted changes that can affect the receiver.

public void objectDidBeginEditing(Object editor)

Availability
See Also

objectDidEndEditing

Invoked to inform the receiver that editor has committed or discarded its changes.

public void objectDidEndEditing(Object editor)

Availability
See Also


Next Page > Hide TOC


© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.