Posted By

suibhne on 11/07/09


Tagged

Objective-c iphone


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

jodm
umang_nine
avanadra
LockeCole117
bobbym245
sb
nsbuckner
gospaz


Populate UIImageView from URL


 / Published in: Objective C
 

Populate a UIImageView with an image taken from a URL.

  1. NSString* imageURL = @"http://theurl.com/image.gif";
  2. NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:mapURL]];
  3.  
  4. UIImage* image = [[UIImage alloc] initWithData:imageData];
  5. [imageView setImage:image];
  6. [imageData release];
  7. [image release];

Report this snippet  

You need to login to post a comment.