Mac Developer Library

Developer

AddressBook Framework Reference ABMultiValue Class Reference

Options
Deployment Target:

On This Page
Language:

ABMultiValue

The ABMultiValue and ABMutableMultiValue classes are used to represent properties that might have multiple values. Each value in a multivalue list must be of the same type, and must have an associated predefined or user-defined label, and unique identifier. The labels, however, need not be unique. For example, you can have multiple Home phone numbers. Each multivalue object may have a primary identifier—used as a default value when a label is not provided. For example, a person record may have multiple addresses with the labels Home and Work, where Work is designated as the primary value. Instances of this class are immutable, see ABMutableMultiValue for methods that manipulate the content of a multivalue list. More...

Inheritance


Import Statement


import AddressBook @import AddressBook;

Availability


Available in OS X v10.2 and later.
  • Returns the identifier for the given index.

    Declaration

    Swift

    func identifierAtIndex(_ index: Int) -> String!

    Objective-C

    - (NSString *)identifierAtIndex:(NSUInteger)index

    Parameters

    index

    The index of the identifier to be returned.

    Discussion

    If the index argument is out of bounds, this method raises an exception.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.2 and later.

  • Returns the index for the given identifier.

    Declaration

    Swift

    func indexForIdentifier(_ identifier: String!) -> Int

    Objective-C

    - (NSUInteger)indexForIdentifier:(NSString *)identifier

    Parameters

    identifier

    The identifier whose index will be returned.

    Discussion

    If the identifier is not found, returns NSNotFound.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.2 and later.

  • Returns the label for the given index.

    Declaration

    Swift

    func labelAtIndex(_ index: Int) -> String!

    Objective-C

    - (NSString *)labelAtIndex:(NSUInteger)index

    Parameters

    index

    The index for the label to be returned.

    Discussion

    If the index argument is out of bounds, this method raises an exception.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.2 and later.

  • Returns the value for the given index.

    Declaration

    Swift

    func valueAtIndex(_ index: Int) -> AnyObject!

    Objective-C

    - (id)valueAtIndex:(NSUInteger)index

    Parameters

    index

    The index for the value to be returned.

    Discussion

    If the index argument is out of bounds, this method raises an exception.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.2 and later.

  • Returns the value for the given identifier.

    Declaration

    Swift

    func valueForIdentifier(_ identifier: String!) -> AnyObject!

    Objective-C

    - (id)valueForIdentifier:(NSString *)identifier

    Parameters

    identifier

    The identifier for the value to be returned.

    Discussion

    If the identifier is not found, returns nil.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.5 and later.

  • Returns the label for the given identifier.

    Declaration

    Swift

    func labelForIdentifier(_ identifier: String!) -> AnyObject!

    Objective-C

    - (id)labelForIdentifier:(NSString *)identifier

    Parameters

    identifier

    The identifier for the label to be returned.

    Discussion

    If the identifier is not found, this method returns nil.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.5 and later.

  • Returns the number of entries in a multivalue list.

    Declaration

    Swift

    func count() -> Int

    Objective-C

    - (NSUInteger)count

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.2 and later.

  • Returns the type for the values in a multivalue list.

    Declaration

    Swift

    func propertyType() -> ABPropertyType

    Objective-C

    - (ABPropertyType)propertyType

    Discussion

    If the multivalue list is empty or its values are of different types, it returns kABErrorInProperty.

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.2 and later.