How to get ABRecordRef from ABRecordID?
Asked Answered
P

1

8

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
}
Puleo answered 27/12, 2012 at 13:22 Comment(0)
N
12

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.

Nimbus answered 27/12, 2012 at 14:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.