ios - Get NSURL for image data of contact -


i need reference url stored image of contact.

if i'm getting image uiimagepickercontroller, can doing this.

nsurl *imageurl = [info objectforkey:uiimagepickercontrollerreferenceurl];

but how nsurl image of contact address book?

uiimage *contactimage = [uiimage imagewithdata:cfbridgingrelease(abpersoncopyimagedata(ref))];

i.e. reference url contactimage.

the ref argument in question not nsurl, abrecordref, i.e. reference address book record. had first open address book using code

cferrorref error = nil; abaddressbookref addressbookref = abaddressbookcreatewithoptions (null, &error); 

and find required person using e.g.

abrecordref ref = abaddressbookgetpersonwithrecordid (addressbookref,recordid);   

this gives required ref.


Comments