A set of methods that you can use to create and remove bindings between view objects and controllers, or between controllers and model objects.


The NSKeyValueBindingCreation informal protocol also provides a means for a view subclass to advertise the bindings that it exposes. The protocol is implemented by NSObject and its methods can be overridden by view and controller subclasses.

When a new binding is created it relates the receiver’s binding (for example, a property of the view object) to a property of the observable object specified by a key path. When the value of the specified property of the observable object changes, the receiver is notified using the key-value observing mechanism. A binding also specifies binding options that can further customize how the observing and the observed objects interact.

Bindings are considered to be a property of the object which is bound, and all information related to bindings should be owned by the object. All standard bindings on AppKit objects (views, cells, table columns, controllers) unbind their bindings automatically when they are deallocated, but if you create key-value bindings for other kind of objects, you need to make sure that you remove those bindings before deallocation (observed objects have weak references to their observers, so controllers/model objects might continue referencing and messaging the objects that were bound to them).

Bindings between objects are typically established in Interface Builder using the Bindings inspector. However, there are times it must be done programmatically, such as when establishing a binding between objects in different nib files.

NSView subclasses can expose additional key-value-coding/key-value-observing compliant properties as bindings by calling the class method exposeBinding: for each of the properties. This is typically done in the class’s initialize method. By exposing the bindings that an object supports and creating an Interface Builder palette, you can make instances of your own classes bindable in Interface Builder.


Exposing bindings

+ exposeBinding:

Exposes the specified binding, advertising its availability.


Returns an array containing the bindings exposed by the receiver.

Managing bindings

- valueClassForBinding:

Returns the class of the value that will be returned for the specified binding.

- bind:toObject:withKeyPath:options:

Establishes a binding between a given property of the receiver and the property of a given object specified by a given key path.

- optionDescriptionsForBinding:

Returns an array describing the options for the specified binding.

- infoForBinding:

Returns a dictionary describing the receiver’s binding.

- unbind:

Removes a given binding between the receiver and a controller.


Tests whether a given object is special marker object used for indicating the state of a selection in relation to a key.



Values that specify a binding for certain methods.


Values that are used as keys in the options dictionary passed to the bind:toObject:withKeyPath:options: method.

Binding Dictionary Keys

The following values are used as keys in the dictionary returned by infoForBinding:

See Also

Key-Value Data


A bindings-compatible controller that manages the display and editing of a dictionary of key-value pairs.


A set of methods implemented by arranged objects to give access to information about those objects.