Question

I want to load a existing contact using the address book view controller using only the uniqueID of the contact. How can a "person" record be defined using only the uniqueID?

ABPersonViewController *view = [[ABPersonViewController alloc] init];

view.personViewDelegate = self;
view.displayedPerson = person; 

[self.navigationController pushViewController:view animated:YES];
Was it helpful?

Solution

Not sure if this it what you are asking, but you create a person for ABPersonViewController like this.

CFErrorRef err;
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, &err);
ABRecordRef person = (ABRecordRef)ABAddressBookGetPersonWithRecordID(addressBook, [contact.recordId intValue]);

personVC.displayedPerson = person;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top