Chiron Chiron - 1 year ago 97
iOS Question

Get a list of all contacts on iOS

I want to get a list of all contacts of an iPhone.

I checked

Address Book
reference, I may missed something but I didn't see it provides a method to get a list of contacts.

Answer Source

Perhaps ABPerson function ABAddressBookCopyArrayOfAllPeople might do?


ABAddressBookRef addressBook = ABAddressBookCreate( );
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople( addressBook );
CFIndex nPeople = ABAddressBookGetPersonCount( addressBook );

for ( int i = 0; i < nPeople; i++ )
    ABRecordRef ref = CFArrayGetValueAtIndex( allPeople, i );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download