1
在我的iOS應用程序中,我想查找與名稱匹配的聯繫人的電話號碼。如何搜索聯繫人的電話號碼? (Abaddressbook)
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?
}