Class

CNMutableContact

A mutable object that stores information about a single contact, such as the contact's first name, phone numbers, and addresses.

Declaration

@interface CNMutableContact : CNContact

Overview

CNMutableContact objects are not a thread-safe class. To access the contact information in a thread-safe manner, use a CNContact object instead.

You may modify only those properties whose values you fetched from the contacts database. When fetching a contact, you specify which properties you want to retrieve from the database. The contact store then populates the properties of a CNContact object with those values. After creating a mutable copy of that object, you can modify only those properties for which a value exists. If you attempt to access a property that is not available, the CNMutableContact object throws a CNContactPropertyNotFetchedExceptionName exception.

To remove the value for a property, set string and array properties to empty, and set all other properties to nil.

Topics

Setting the Identity of the Contact

contactType

An enum identifying the contact type.

Setting Name Information

namePrefix

The name prefix of the contact.

givenName

The given name of the contact.

middleName

The middle name of the contact.

familyName

The family name of the contact.

previousFamilyName

The previous family name of the contact.

nameSuffix

The name suffix of the contact.

nickname

The nickname of the contact.

phoneticGivenName

The phonetic given name of the contact.

phoneticMiddleName

The phonetic middle name of the contact.

phoneticFamilyName

The phonetic family name of the contact.

Setting Work Information

jobTitle

The contact’s job title.

departmentName

The name of the department associated with the contact.

organizationName

The name of the organization associated with the contact.

phoneticOrganizationName

The phonetic name of the organization associated with the contact.

Setting Addresses

postalAddresses

An array of labeled postal addresses for a contact.

emailAddresses

An array of labeled email addresses for the contact.

urlAddresses

An array of labeled URL addresses for a contact.

Setting Phone Information

phoneNumbers

An array of labeled phone numbers for a contact.

Setting Social Profiles

socialProfiles

An array of labeled social profiles for a contact.

Setting Birthday Information

dates

An array containing labeled Gregorian dates.

nonGregorianBirthday

A date component for the non-Gregorian birthday of the contact.

birthday

A date component for the Gregorian birthday of the contact.

Setting Notes

note

A string containing notes for the contact.

Setting Images

imageData

The profile picture of a contact.

Relating Other Information to the Contact

contactRelations

An array of labeled contact relations for the contact.

instantMessageAddresses

An array of labeled IM addresses for the contact.

Relationships

Inherits From

See Also

Contact Data

CNContact

An immutable object that stores information about a single contact, such as the contact's first name, phone numbers, and addresses.

Data Objects

Access contact-related data, such as the user's postal address and phone number.

Contact Keys

Specify contact-related properties during fetch operations.