I am having a strange issue using the C based AddressBook API, whereby if I do a count of all the people in my address book I get a very large number. (it goes up add I add additional contacts). On a test machine I get 42 for 4 contacts. I want to get a count of all the people so I can loop through them.
If I do a CFShow of the all_people array, everything looks fine. Am I doing something stupid with CFArrayGetCount() ?
Code:
ABAddressBookRef address_book = ABGetSharedAddressBook();
CFArrayRef all_people = NULL;
all_people = ABCopyArrayOfAllPeople(address_book);
int count = CFArrayGetCount(all_people);
If I do a CFShow of the all_people array, everything looks fine. Am I doing something stupid with CFArrayGetCount() ?