Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add image contact in address book


how can i use kABPersonImageFormatThumbnail or something else to set an image to a contact in address book???

I want use a /resources file.


Now i use

ABMultiValueAddValueAndLabel(multiPhone, @"+39-02-1234567", kABWorkLabel, NULL);

to set a value in address book.

An image seems to be the same behavior, but what type need use?

ABMultiValueAddValueAndLabel(multiPhone, ?????, kABPersonImageFormatThumbnail, NULL);

Thanks
A

like image 632
elp Avatar asked Dec 02 '25 08:12

elp


1 Answers

Ouch... resolved!

UIImage *im = [UIImage imageNamed:@"my_image.jpg"];
NSData *dataRef = UIImagePNGRepresentation(im);
ABPersonSetImageData(person, (CFDataRef)dataRef, nil);

>>> objective-c-add-contact-contacts-list

thanks all.

like image 174
elp Avatar answered Dec 04 '25 00:12

elp



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!