Created
January 8, 2012 00:11
-
-
Save MKSG-MugunthKumar/1576556 to your computer and use it in GitHub Desktop.
MKNetworkEngine and UIImageView
This file contains 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
[AppDelegate.imageFetcher imageAtURL:self.profile.avatarURL | |
onCompletion:^(UIImage *image, NSURL *url, BOOL isInCache) | |
{ | |
// this "if" is to prevent images flashing repeatedly when cells are reused. | |
if ([[self.profile.avatarURL absoluteString] isEqualToString:[url absoluteString]]) { | |
self.avatarImageView.image = resizedImage; | |
} | |
}]; |
Read my latest post on this
thanks Mugunth, I intend to. I saw on twitter you had written this. much appreciated.
Regards
Nik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Mugunth, apologies if I'm unclear. Basically the tableview image is not refreshed until the tableview reloads.
There is likely a very simple solution which I'm missing, but any assistance in understanding how I can check the MKNetworkKit cache before starting the block request and thereby having the image show immediately would be greatly appreciated.
Previously I would maintain a dictionary of cached images in my app Delegate and either show if the URL was already available in the cache or start an NSOperation to grab it.
cheers
Nik