Contents

setValue(_:forProperty:error:)

Sets the value of a given property for a record, returning error information.

Declaration

func setValue(_ value: Any!, forProperty property: String!, error: ()) throws

Parameters

  • value:

    The value to set for property.

  • property:

    The property whose value will be set.

  • error:

    A pointer to an error object that is set to an Nserror instance if an error occurs.

Discussion

The type of the value must match the property’s type (see Property Types for a list of possible property types). If property is nil or if value is not of the correct type, this method raises an exception. If property is a multivalue list property, this method checks to see if the values in the multivalue list are the same type. If the multivalue list contains mixed types, the value will not be set successfully.

For a list of the available properties, see Accessing Address Book Records in Address Book Programming Guide for Mac.

See Also

Retrieving and Setting Values