Created
October 24, 2012 19:51
-
-
Save kirbyt/3948400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WPSImageDownloaderCompletionBlock completion = ^(UIImage *image, NSError *error) { | |
if (image) { | |
NSData *pngData = UIImagePNGRepresentation(image); | |
[[self imageCache] cacheData:pngData forKey:cacheKey cacheLocation:WPSCacheLocationFileSystem]; | |
cell.imageView.image = image; | |
} else { | |
ZAssert(error, @"Image download error: %@\n%@", [error localizedDescription], [error userInfo]); | |
} | |
}; | |
cell.imageView.image = [self placeholderImage]; | |
WPSImageDownloader *downloader = [[WPSImageDownloader alloc] init]; | |
[downloader setRetryCount:5]; | |
[downloader setCache:[self imageCache]]; | |
[downloader downloadImageAtURL:imageURL completion:completion]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment