Function

ABMultiValueInsert

Inserts a value and its label at the given index in a multi-value list.

Declaration

bool ABMultiValueInsert(ABMutableMultiValueRef multiValue, CFTypeRef value, CFStringRef label, CFIndex index, CFStringRef *outIdentifier);

Parameters

multiValue

The multi-value list you wish to modify.

value

An object representing a value in a multi-value list--it must be of the correct type. For example, if multiValue is the value for a property of type kABMultiStringProperty, then value needs to be a CFString object. See Property Types for a list of supported types in a multi-value list (see descriptions of the kABMulti... constants). If value is NULL, this function raises an exception.

label

The label for value—it need not be unique. If label is NULL, this function raises an exception.

index

The index to insert value at. If index is out of bounds, this function raises an exception.

outIdentifier

If value is added successfully, this parameter returns the new identifier.

Return Value

true if successfully, false otherwise.

Discussion

This function performs no type checking and will let you add a value whose type does not match the types of the other values in the list. However, if you try to use a multi-value list whose values are not all of the same type, functions, such as the ABRecord ABRecordSetValue function, will returns NULL or kABErrorProperty.

See Also

Multi Values

ABMultiValueAdd

Adds a value and its label to a multi-value list.

ABMultiValueCopyIdentifierAtIndex

Returns the identifier at the given index.

ABMultiValueCopyLabelAtIndex

Returns the label for the given index.

ABMultiValueCopyPrimaryIdentifier

Returns the identifier for the primary value.

ABMultiValueCopyValueAtIndex

Returns the value for the given index.

ABMultiValueCount

Returns the number of entries in a multi-value list.

ABMultiValueCreate

Returns a new ABMultiValue object.

ABMultiValueCreateCopy

Returns a copy of a multi-value object.

ABMultiValueCreateMutable

Returns a newly created mutable multi-value list object.

ABMultiValueCreateMutableCopy

Returns a mutable copy of a multi-value object.

ABMultiValueIndexForIdentifier

Returns the index for the given identifier.

ABMultiValuePropertyType

Returns the type for the values in a multi-value list.

ABMultiValueRemove

Removes the value and label at the given index.

ABMultiValueReplaceLabel

Replaces the label at the given index.

ABMultiValueReplaceValue

Replaces the value at the given index.

ABMultiValueSetPrimaryIdentifier

Sets the primary value to be the value for the given identifier.