【发布时间】:2013-04-01 18:32:55
【问题描述】:
在我的 iOS 应用中,我想查找与姓名匹配的联系人的电话号码。
CFErrorRef *error = NULL;
// Create a address book instance.
ABAddressBookRef addressbook = ABAddressBookCreateWithOptions(NULL, error);
// Get all people's info of the local contacts.
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressbook);
CFIndex numPeople = ABAddressBookGetPersonCount(addressbook);
for (int i=0; i < numPeople; i++) {
// Get the person of the ith contact.
ABRecordRef person = CFArrayGetValueAtIndex(allPeople, i);
## how do i compare the name with each person object?
}
【问题讨论】:
标签: ios objective-c abaddressbook