Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kABPersonImageFormatThumbnail not pulling images

Most of my contacts image are pulled in from image and when I do:

NSData *contactImageData = (__bridge NSData*) ABPersonCopyImageDataWithFormat(person,
                                                                                  kABPersonImageFormatThumbnail);
    UIImage *img = [[UIImage alloc] initWithData:contactImageData];

the img here is nil. How can I get the image?

like image 380
adit Avatar asked Dec 17 '12 05:12

adit


1 Answers

Before fetching image please check if the address does have image property using the below line.

if(ABPersonHasImageData(person)) {
    //Code to fetch image
}
like image 86
Paramasivan Samuttiram Avatar answered Nov 01 '22 03:11

Paramasivan Samuttiram