Friday, March 18, 2011

create person ABRecordRef: adding a contact to address book



CFErrorRef error = NULL;

ABAddressBookRef iPhoneAddressBook = ABAddressBookCreate();


ABRecordRef newPerson = ABPersonCreate();

ABRecordSetValue(newPerson, kABPersonFirstNameProperty, @"John", &error);

ABRecordSetValue(newPerson, kABPersonLastNameProperty, @"Doe", &error);

Here is the whole guide, it's very complete:


Source: http://www.modelmetrics.com/tomgersic/iphone-programming-adding-a-contact-to-the-iphone-address-book/

No comments: