I have uitableview with cells.I download image asynchronous for each cell with ASIHttpRequest and put image into cell when it has been downloaded. Image downloads fine, but it puts when i click on cell, or scroll my uitableview. How to set image AND SHOW it immediatly?
NSURL *photoURL = [NSURL URLWithString:urlString];
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:photoURL];
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request setCompletionBlock:^{
NSData *responseData = [request responseData];
cell.imageView.image = [UIImage imageWithData:responseData];
}];
[request startAsynchronous];
//other code (cell.textLabe.text = ...) etc.
Here are screenshots with cell before click on it, and after:
Before:
After:
Copyright Notice:Content Author:「Timur Mustafaev」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7240074/uitableviewcell-update