I'm reading contact's image from c ABAddressBook API like this:
NSData *photoData;
ABRecordRef personRef = ABAddressBookGetPersonWithRecordID(bookRef, ID);
// Photo data
if (ABPersonHasImageData(personRef)) {
photoData = (__bridge_transfer NSData *) ABPersonCopyImageData(personRef);
}
The problem is that this need's to be done asynchrously, because there are displaying issues in tableView while listing all contacts. I know there is one function in API called 'beginLoadingImageDataForClient' but I am not able to find out how to use it. Could you help me to implement it this way? Thanks
Try this
We're pushing the data request off the main thread, then calling back to the main thread when the data is ready.