philfreo philfreo - 1 year ago 119
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