Closed rashidasgari closed 10 years ago
Hi, thanks for the amazing work! I have faced this one issue. I want to pass NSURLS to the class and cache the images from a website.
(UIImage )photoBrowser:(AGPhotoBrowserView )photoBrowser imageAtIndex:(NSInteger)index { __block UIImage *image;
NSURL *url = [NSURL URLWithString:[photoArray objectAtIndex:index]];
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse _response, NSData _data, NSError *_error) {
image = [UIImage imageWithData:_data];
}];
return image; } Now the problem is that the block takes a long time to complete while the return image is reached earlier. Have you done anything about this issue?
Hi, thanks for the amazing work! I have faced this one issue. I want to pass NSURLS to the class and cache the images from a website.
(UIImage )photoBrowser:(AGPhotoBrowserView )photoBrowser imageAtIndex:(NSInteger)index { __block UIImage *image;
NSURL *url = [NSURL URLWithString:[photoArray objectAtIndex:index]];
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse _response, NSData _data, NSError *_error) {
image = [UIImage imageWithData:_data];
}];
return image; } Now the problem is that the block takes a long time to complete while the return image is reached earlier. Have you done anything about this issue?