NSPlaceholders Protocol Reference

(informal protocol)

Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.3 and later.
Companion guide
Declared in
NSKeyValueBinding.h

Overview

The NSPlaceholders protocol provides an interface that allows an object to register default placeholders that will be displayed for a binding, when no other placeholder has been specified. Individual placeholder values can be specified for each of the marker objects (described in “Selection Markers”), as well as when the property is nil.

Placeholders are used when a property of an instance of the receiving class is accessed through a key value coding compliant method, and returns nil or a specialized marker.

Tasks

Managing Default Placeholders

Class Methods

defaultPlaceholderForMarker:withBinding:

Returns an object that will be used as the placeholder for the binding, when a key value coding compliant property of an instance of the receiving class returns the value specified by marker, and no other placeholder has been specified.

+ (id)defaultPlaceholderForMarker:(id)marker withBinding:(NSString *)binding
Discussion

The marker can be nil or one of the constants described in “Selection Markers”.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSKeyValueBinding.h

setDefaultPlaceholder:forMarker:withBinding:

Sets placeholder as the default placeholder for the binding, when a key value coding compliant property of an instance of the receiving class returns the value specified by marker, and no other placeholder has been specified.

+ (void)setDefaultPlaceholder:(id)placeholder forMarker:(id)marker withBinding:(NSString *)binding
Discussion

The marker can be nil or one of the constants described in “Selection Markers”.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSKeyValueBinding.h

Constants

Selection Markers

The following constants are used to describe special cases for a controller’s selection.

id NSMultipleValuesMarker;
id NSNoSelectionMarker;
id NSNotApplicableMarker;
Constants
NSMultipleValuesMarker

This marker indicates that a key’s value contains multiple values that differ.

A binding can be configured to always return this marker for multiple items, even if the values are the same.

Available in OS X v10.3 and later.

Declared in NSKeyValueBinding.h.

NSNoSelectionMarker

This marker indicates that the controller’s selection is currently empty.

Available in OS X v10.3 and later.

Declared in NSKeyValueBinding.h.

NSNotApplicableMarker

This marker indicates that an object is not key-value coding compliant for the requested key.

Available in OS X v10.3 and later.

Declared in NSKeyValueBinding.h.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSKeyValueBinding.h