I am using SDWebImage library in order to download and cache images and from a web service asynchronously. Following is the method i use to download the images:
- (void) downloadThumbnails:(NSURL *)finalUrl
{
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadWithURL:finalUrl
options:0
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished)
{
if (image)
{
[self setThumbnail:image];
}
}];
}
It is successfully downloading the images from the web service and showing them in the tableview. However its not persisting the images between application runs. Is there anything else i need to do in order to cache the images??
UPDATE: KINDLY DO NOT suggest to use the following:
[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
Because, the structure of my program is different. Secondly, if you read description of the SDWebImage library HERE, you will get to know that it can be used the way i am using it using SDWebImageManager.