iOS Developer Library

Developer

AddressBook Framework Reference ABMultiValue Reference

Options
Deployment Target:

On This Page
Language:

ABMultiValue Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AddressBook

Objective-C

@import AddressBook;

The ABMultiValue opaque type (whose objects are known as multivalues) implements a property that can have multiple values. All the contained values must be of the same type. Each value has a unique identifier and a nonunique label, which may be one of the provided labels or one defined by the user.

For example, if a multivalue property is used to store phone numbers, there may be multiple work phone numbers. These have the same label, but different unique identifiers.

Multivalue properties are immutable. To use mutable multivalue properties, see ABMutableMultiValue Reference.

Functions

  • Returns the value at a particular location within a multivalue property.

    Declaration

    Swift

    func ABMultiValueCopyValueAtIndex(_ multiValue: ABMultiValue!, _ index: CFIndex) -> Unmanaged<AnyObject>!

    Objective-C

    CFTypeRef ABMultiValueCopyValueAtIndex ( ABMultiValueRef multiValue, CFIndex index );

    Parameters

    multiValue

    The multivalue property from which to obtain the value.

    index

    Location of the desired value within multiValue.

    Raises an exception when out of bounds.

    Return Value

    The value at index in multiValue.

    Discussion

    This function takes an index. If you have an identifier, use the ABMultiValueGetIndexForIdentifier function to get the corresponding index.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns an array with the values in a multivalue property.

    Declaration

    Swift

    func ABMultiValueCopyArrayOfAllValues(_ multiValue: ABMultiValue!) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABMultiValueCopyArrayOfAllValues ( ABMultiValueRef multiValue );

    Parameters

    multiValue

    The multivalue property whose values are being return.

    Return Value

    Array containing the values in multiValue.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns the number of values in a multivalue property.

    Declaration

    Swift

    func ABMultiValueGetCount(_ multiValue: ABMultiValue!) -> CFIndex

    Objective-C

    CFIndex ABMultiValueGetCount ( ABMultiValueRef multiValue );

    Parameters

    multiValue

    The multivalue property whose value are being counted.

    Return Value

    The number of values in multiValue.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns the first location of a value in a multivalue property.

    Declaration

    Swift

    func ABMultiValueGetFirstIndexOfValue(_ multiValue: ABMultiValue!, _ value: AnyObject!) -> CFIndex

    Objective-C

    CFIndex ABMultiValueGetFirstIndexOfValue ( ABMultiValueRef multiValue, CFTypeRef value );

    Parameters

    multiValue

    The multivalue property in which to search for value.

    value

    The value to search for in multiValue.

    Return Value

    Location of value within multiValue, -1 if value is not present in multiValue.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns the label for a value in a multivalue property.

    Declaration

    Swift

    func ABMultiValueCopyLabelAtIndex(_ multiValue: ABMultiValue!, _ index: CFIndex) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef ABMultiValueCopyLabelAtIndex ( ABMultiValueRef multiValue, CFIndex index );

    Parameters

    multiValue

    The multivalue property with the value whose label to return.

    index

    Location of the value within multiValue whose label to return.

    Raises an exception when out of bounds.

    Return Value

    Label for the value at index within multiValue.

    Discussion

    If there is no label for the value at index, returns NULL.

    This function takes an index. If you have an identifier, use the ABMultiValueGetIndexForIdentifier function to get the corresponding index.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns the identifier of a value in a multivalue property.

    Declaration

    Swift

    func ABMultiValueGetIdentifierAtIndex(_ multiValue: ABMultiValue!, _ index: CFIndex) -> ABMultiValueIdentifier

    Objective-C

    ABMultiValueIdentifier ABMultiValueGetIdentifierAtIndex ( ABMultiValueRef multiValue, CFIndex index );

    Parameters

    multiValue

    The multivalue property with the identifier to return.

    index

    Location of the value within multiValue whose identifier is being returned.

    Return Value

    Identifier of the value at index within multiValue.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns the location (within a multivalue property) of a value with a given identifier.

    Declaration

    Swift

    func ABMultiValueGetIndexForIdentifier(_ multiValue: ABMultiValue!, _ identifier: ABMultiValueIdentifier) -> CFIndex

    Objective-C

    CFIndex ABMultiValueGetIndexForIdentifier ( ABMultiValueRef multiValue, ABMultiValueIdentifier identifier );

    Parameters

    multiValue

    The multivalue property in which to look for the identifier value identifier.

    identifier

    The identifier of the value whose location within multiValue is being returned.

    Return Value

    Location within multiValue that contains the value with identifier as its identifier.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Returns the type of the values contained in a multivalue property.

    Declaration

    Swift

    func ABMultiValueGetPropertyType(_ multiValue: ABMultiValue!) -> ABPropertyType

    Objective-C

    ABPropertyType ABMultiValueGetPropertyType ( ABMultiValueRef multiValue );

    Parameters

    multiValue

    The multivalue property whose type is being returned.

    Return Value

    The type of the values contained in multiValue or kABInvalidPropertyType when multiValue is empty or contains values of different types.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

Data Types

  • Reference to a multivalue property.

    Declaration

    Swift

    typealias ABMultiValueRef = ABMultiValue

    Objective-C

    typedef CFTypeRef ABMultiValueRef;

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

  • Identifies multivalue properties.

    Declaration

    Swift

    typealias ABMultiValueIdentifier = Int32

    Objective-C

    typedef int32_t ABMultiValueIdentifier;

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

Constants

  • This preprocessor definition identifies an multivalue property with values whose type does not match its declared type.

    Declaration

    Swift

    var kABMultiValueInvalidIdentifier: Int32 { get }

    Objective-C

    #define kABMultiValueInvalidIdentifier -1

    Constants

    • kABMultiValueInvalidIdentifier

      kABMultiValueInvalidIdentifier

      Invalid multivalue property.

      Available in iOS 2.0 and later.

    Discussion

    See ABMultiValueIdentifier.