i have one NSMutableArray
with some image url\'s. The images have sizes between 12KB to 6MB. I use AsycImageView
class and implement but when large
You could download image asynchronously using GCD. Use the following code,
__block NSData *imageData;
dispatch_queue_t myQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, NULL);
dispatch_async(myQueue, ^{
//load url image into NSData
imageData = [NSData dataWithContentsOfURL: your_image_URL];
if(imageData) {
dispatch_sync(dispatch_get_main_queue(), ^{
//convert data into image after completion
UIImage *img = [UIImage imageWithData:imageData];
//do what you want to do with your image
});
} else {
NSLog(@"image not found at %@", your_image_URL);
}
});
dispatch_release(myQueue);
For further info, see dispatch_queue_t