i have to display 11 images in single cell ,all that images are downloaded from server, so when my tableview show than i wanna download all images from server & display it in custom cell. I have used lazyloading sample code. But t can download 1 image at a time. it not feasible according to my requirement. Is there any way to solve this problem???
[NSThread detachNewThreadSelector:@selector(downloadImage:) toTarget:self withObject:@"Image URL"];
-(void)downloadImage:(NSString *)inURL { NSAutoreleasePool *thePool = [[NSAutoreleasePool alloc]init]; UIImage *theImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:inURl]]; [self performSelectorOnMainThread:@selector(uploadImage:) withObject:theImage waitUntilDone:NO]; [thePool drain]; }
-(void)uploadImage:(UIImage *)inImage { [inImage retain]; // add image to View.[inImage relese]; }