Count total number of Phone Numbers in AddressBook iPhone
-
26-09-2019 - |
Question
I am trying to get the total count for the phone numbers listed in the AddressBook, in all groups as a whole.
I can successfully retrieve Person count and Group count, just not the total number of Phone Numbers.
ABAddressBookRef m_addressbook = ABAddressBookCreate();
CFIndex nPeople = ABAddressBookGetPersonCount(m_addressbook);
CFIndex nGroups = ABAddressBookGetGroupCount(m_addressbook);
Solution
CFIndex nPeople = ABAddressBookGetPersonCount(m_addressbook);
Should return the count for everyone in the address book.
OTHER TIPS
Try this:
ABAddressBookRef addressbook = ABAddressBookCreate();
int nPeople = ABAddressBookGetPersonCount(addressbook);
printf("%d",nPeople);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow