I have an iphone application.Within which I want to get all the iphone address book contacts in an array.
Is that possible?
I have an iphone application.Within which I want to get all the iphone address book contacts in an array.
Is that possible?
Looks like it:
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);
for( int i = 0 ; i < nPeople ; i++ ) {
ABRecordRef ref = CFArrayGetValueAtIndex(allPeople, i );
NSLog(@"inside loop");
}