Possible Duplicate:
Download image asynchronously
I would like to download multiple images asynchronously. I have array of 10 images and I want to show these images in 10 uiimageview
, I am doing like this but it show only one image
- (void)loadImage {
NSData* imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[myarray objectatindex:0]]];
UIImage* image = [[[UIImage alloc] initWithData:imageData] autorelease];
[imageData release];
[self performSelectorOnMainThread:@selector(displayImage:) withObject:image waitUntilDone:NO];
}
The final method we need to create takes in the image to display and sets it on our image view.
- (void)displayImage:(UIImage *)image {
[imageView setImage:image]; //UIImageView
}
So kindly tell me how I can show multiple images on different without creating 10 different methods.