如何从ABRecordID获取ABRecordRef?
我已经访问了地址簿,成功地从中提取了logging和必要的信息。 我也提取了recordid 。 我的问题是如何使用此recordid以后提取logging。 我正在使用的代码是:
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 }
显然, ABAddressBookCopyArrayOfAllPeople
的结果是ABPersonRef
一个数组,然后您单独使用它来获取您的ABRecordID
。 如果在稍后的某个时刻,您想要使用ABAddressBookGetPersonWithRecordID
来检索ABPersonRef
,则使用ABAddressBookGetPersonWithRecordID
。