I find that in development, in my contacts, ABRecordCopyCompositeName returns NULL for a few records, but when I view my contact list normally, I don’t see any missing names.
What’s a standard alternative label to use if ABRecordCopyCompositeName returns a NULL? Also, what causes the NULL values to exist in the first place?
(EDIT: title corrected)
Strangely:
- The count at the bottom of the “Contacts” iPhone app states 119 contacts.
- I counted all entries – all 119 are there and have names.
- [ABAddressBookCopyDefaultSource(addressBook) count] returns 116, not 119.
- Counting each entry from ABAddressBook, I get 116, including the 3 null entries.
So, on top of three null entries, I’m missing 3 more.
I’m still looking for a better answer, but until then, here’s what I’ve found:
The three ‘missing’ records are still confusing me. I believe they are also imported from Exchange, but just not included in the ABAddressBookCopyDefaultSource request.
My work-around was to not fill out table cells directly from ABAddressBook, but to copy the entries into an array first, so that the counts are correct. As I get further toward release, I may circle back to this routine and change it so that very large address books will not cause memory issues.