Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying an Image from URL Objective C

Is there any way of achieving the following that avoids using "initWithData" ? (Just in case you are curious, initWithData is getting my app flagged by Apple as using an illegal API sigh).

NSData * imageData = [NSData dataWithContentsOfURL : [NSURL URLWithString : [details image]]];
    picture = [[UIImage alloc] initWithData:imageData];

Many thanks,

Martin

like image 678
GuybrushThreepwood Avatar asked Dec 10 '22 09:12

GuybrushThreepwood


1 Answers

if you want to get the image data,then initialize a UIImage using that data:

NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: @"http://Serverurl/pic007.jpg"]];
cell.image = [UIImage imageWithData: imageData];
[imageData release];
like image 64
Jhaliya - Praveen Sharma Avatar answered Dec 21 '22 04:12

Jhaliya - Praveen Sharma