Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get ABRecordRef from ABRecordID?

I have accessed the address book and success fully extracted the records and necessary info from it. I have also extracted recordid. My problem is how to use this recordid to extract record later. The code which I am using is:

ABRecordID recordId;
ABAddressBookRef _addressBookRef = ABAddressBookCreate ();
NSArray* allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(_addressBookRef);

for (id record in allPeople) {
    recordId = ABRecordGetRecordID(record);

    //i am saving each one  how to use them later to extract particular record
}
like image 726
amar Avatar asked Dec 27 '12 13:12

amar


1 Answers

Obviously, the results of ABAddressBookCopyArrayOfAllPeople is an array of ABPersonRef, which you then individually use to get your ABRecordID. If at some later point, you want to take your recordId to retrieve the ABPersonRef, you use ABAddressBookGetPersonWithRecordID.

like image 150
Rob Avatar answered Oct 08 '22 17:10

Rob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!