Mac Developer Library

Developer

AppKit Framework Reference NSDictionaryController Class Reference

Options
Deployment Target:

On This Page
Language:

NSDictionaryController

NSDictionaryController is a bindings compatible class that manages display and editing of the contents of an NSDictionary object. NSDictionaryController 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 NSTableView. More...

Conforms To


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.5 and later.
  • Creates and returns a new key-value pair to represent an entry in the content dictionary.

    Declaration

    Swift

    func newObject() -> AnyObject

    Objective-C

    - (id)newObject

    Return Value

    An object that represents the key-value pair. The object must not be autoreleased, and must implement the NSDictionaryControllerKeyValuePair informal protocol

    Discussion

    This method is invoked for insertions of new key-value pairs, as well as transforming existing dictionary entries into key-value pairs for display. Objects returned by this method must implement the NSDictionaryControllerKeyValuePair informal protocol.

    Special Considerations

    Subclass implementations must ensure that the object returned by newObject is not autoreleased.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the localized key names that are displayed by the receiver in place of the key names.

    Declaration

    Swift

    var localizedKeyDictionary: [NSObject : AnyObject]

    Objective-C

    @property(copy) NSDictionary *localizedKeyDictionary

    Parameters

    dictionary

    A dictionary containing the localized key name strings.

    Discussion

    The dictionary contains the key names as the keys, and the localized key names as the corresponding values.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the receiver’s localization dictionary.

    Declaration

    Swift

    var localizedKeyDictionary: [NSObject : AnyObject]

    Objective-C

    @property(copy) NSDictionary *localizedKeyDictionary

    Return Value

    A dictionary containing localized string values for the key names.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the strings file used to localize key names.

    Declaration

    Swift

    var localizedKeyTable: String?

    Objective-C

    @property(copy) NSString *localizedKeyTable

    Return Value

    A string that specifies the string table to use when localizing key names.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Specifies the strings file used to localize key names.

    Declaration

    Swift

    var localizedKeyTable: String?

    Objective-C

    @property(copy) NSString *localizedKeyTable

    Parameters

    stringsFile

    Specifies the string table to use when localizing key names.

    Discussion

    The string table must reside within the application’s resource . See Strings Files in Introduction to Internationalization Programming Topics.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the key names that are represented by a key-value pair, even if they are not present in the receiver’s content dictionary.

    Declaration

    Swift

    var includedKeys: [AnyObject]

    Objective-C

    @property(copy) NSArray *includedKeys

    Parameters

    keys

    An array containing the key names.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns an array containing the key names that are represented by a key-value pair, even if they are not present in the receiver’s content dictionary.

    Declaration

    Swift

    var includedKeys: [AnyObject]

    Objective-C

    @property(copy) NSArray *includedKeys

    Return Value

    An array containing the key names.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the key names that are never displayed in the user interface items bound to the receiver.

    Declaration

    Swift

    var excludedKeys: [AnyObject]

    Objective-C

    @property(copy) NSArray *excludedKeys

    Parameters

    keys

    An array containing the key names.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns an array containing the key names that are never displayed in the user interface items bound to the receiver.

    Declaration

    Swift

    var excludedKeys: [AnyObject]

    Objective-C

    @property(copy) NSArray *excludedKeys

    Return Value

    An array containing the key names.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the string used as the initial key name for a newly inserted item.

    Declaration

    Swift

    var initialKey: String

    Objective-C

    @property(copy) NSString *initialKey

    Parameters

    key

    The key name. The string is copied by the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    See Also

    – initialKey

  • Returns the string used as the initial key name for a newly inserted item.

    Declaration

    Swift

    var initialKey: String

    Objective-C

    @property(copy) NSString *initialKey

    Return Value

    The key name.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the string used as the initial value for a newly inserted item.

    Declaration

    Swift

    var initialValue: AnyObject

    Objective-C

    @property(strong) id initialValue

    Parameters

    value

    The initial value.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the string used as the initial value for a newly inserted item.

    Declaration

    Swift

    var initialValue: AnyObject

    Objective-C

    @property(strong) id initialValue

    Return Value

    The value.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • The following constants are used to specify a binding to bind:toObject:withKeyPath:options:, infoForBinding:, unbind:, and valueClassForBinding:. See the Cocoa Bindings Reference for more information.

    Declaration

    Swift

    var NSContentDictionaryBinding: NSString! var NSIncludedKeysBinding: NSString! var NSExcludedKeysBinding: NSString! var NSLocalizedKeyDictionaryBinding: NSString! var NSInitialKeyBinding: NSString! var NSInitialValueBinding: NSString!

    Objective-C

    NSString *NSContentDictionaryBinding; NSString *NSIncludedKeysBinding; NSString *NSExcludedKeysBinding; NSString *NSLocalizedKeyDictionaryBinding; NSString *NSInitialKeyBinding; NSString *NSInitialValueBinding;

    Constants

    • NSContentDictionaryBinding

      NSContentDictionaryBinding

      A dictionary used as the content dictionary.

      Available in OS X v10.5 and later.

    • NSIncludedKeysBinding

      NSIncludedKeysBinding

      An array containing the key-value pairs always represented by the receiver.

      Available in OS X v10.5 and later.

    • NSExcludedKeysBinding

      NSExcludedKeysBinding

      An array containing the key names that are never displayed in the user interface items bound to the receiver.

      Available in OS X v10.5 and later.

    • NSLocalizedKeyDictionaryBinding

      NSLocalizedKeyDictionaryBinding

      A dictionary containing the localized key names that are displayed by the receiver in place of the key names.

      Available in OS X v10.5 and later.

    • NSInitialKeyBinding

      NSInitialKeyBinding

      A string used as the initial key name for newly inserted items.

      Available in OS X v10.5 and later.

    • NSInitialValueBinding

      NSInitialValueBinding

      A string used as the initial value for newly inserted items.

      Available in OS X v10.5 and later.

    Import Statement