A bindings-compatible controller that manages the display and editing of a dictionary of key-value pairs.
- macOS 10.5+
NSDictionary transforms the contents of a dictionary into an array of key-value pairs that can be bound to user interface items such as the columns of an
The content of an
NSDictionary instance is specified using the inherited method
content or by binding an
NSDictionary instance to the
NSContent binding. New key/value pairs inserted into the dictionary are created using the
new method. The initial key name is set to the string returned by
initial . The initial key name is copied to the newly inserted object, while the object returned by
initial is simply retained. As new items are inserted the controller enumerates the initial key name, resulting in key names such as “key”, “key1”, “key2”, and so on. This behavior can be customized by overriding
NSDictionary instance can be configured to exclude specified keys in a dictionary from being returned by
arranged using the
excluded property. Similarly, you can specify an array of key names that are always included in the arranged objects, even if they are not present in the content dictionary, using the
NSDictionary supports providing localized key names for the keys in the dictionary, allowing a user-friendly representation of the key name to be displayed. The localized key names are specified by a dictionary (using
localized) or by providing a strings table (using
arranged method returns an array of objects that implement the
NSDictionary informal protocol. User interface controls are bound to the arranged objects array using key paths such as:
arranged (displays the key name),
arranged (displays the value for the key), or
arranged (displays the localized key name). See
NSDictionary for more information.
The constants listed below are used to specify a binding to
value. See the Cocoa Bindings Reference for more information.