setValue(_:forProperty:)
Sets the value of a given property for a record.
Declaration
func setValue(_ value: Any!, forProperty property: String!) -> BoolParameters
- value:
The value to set for
property. - property:
The property whose value will be set.
Return Value
true if the value was set successfully; otherwise, false.
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.