문제

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];
도움이 되었습니까?

해결책

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;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top