Mac Developer Library

Developer

Address Book Objective-C Framework Reference for Mac 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.

The ABMultiValue class is “toll-free bridged” with its procedural C opaque-type counterpart. This means that the ABMultiValueRef type is interchangeable in function or method calls with instances of the ABMultiValue class.

  • Returns the number of entries in a multivalue list.

    Declaration

    Swift

    func count() -> Int

    Objective-C

    - (NSUInteger)count

    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.

    Availability

    Available in OS X v10.2 and later.