philfreo philfreo - 2 years ago 125
Objective-C Question

iPhone: How to get a UIImage from a url?

How do you download an image and turn it into a UIImage?

Answer Source
NSURL *url = [NSURL URLWithString:@""];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[[UIImage alloc] initWithData:data] autorelease];

However, this isn't asynchronous.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download