我试图获取所有群组中AddressBook中列出的电话号码的总数。
我可以成功检索人数和组计数,而不是电话号码的总数。
ABAddressBookRef m_addressbook = ABAddressBookCreate();
CFIndex nPeople = ABAddressBookGetPersonCount(m_addressbook);
CFIndex nGroups = ABAddressBookGetGroupCount(m_addressbook);
答案 0 :(得分:1)
CFIndex nPeople = ABAddressBookGetPersonCount(m_addressbook);
应该返回地址簿中每个人的计数。
答案 1 :(得分:1)
试试这个:
ABAddressBookRef addressbook = ABAddressBookCreate();
int nPeople = ABAddressBookGetPersonCount(addressbook);
printf("%d",nPeople);