Add image contact in address book


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

I want to use a file /resources.


Now i use

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

to set the value in the address book.

The image looks like the same behavior, but what type should I use?

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

Thanks
A

+3
source share
1 answer

Uch ... solved!

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

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

thank you all.

+9
source

Source: https://habr.com/ru/post/1784392/


All Articles