uitableviewcell update
NickName:Timur Mustafaev Ask DateTime:2011-08-30T15:41:25

uitableviewcell update

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:

Before

After:

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

Answers
Peder Klingenberg 2011-08-30T07:56:07

Try putting [tableView reloadData] inside the completion block.",


PJR 2011-08-30T07:58:16

for updating tableview use\n\n[yourTableView reloadData]\n\nand for download images asynchronously use \n\nhttp://www.markj.net/iphone-asynchronous-table-image/",


More about “uitableviewcell update” related questions

update UITableViewCell from other method

i have search thousand in GG to find solution update data to UITableViewCell but all show me the solution is UITableViewCell *cell=(UITableViewCell*)[self.tableView cellForRowAtIndexPath:indexPat...

Show Detail

IOS how to update UITableViewCell

i make a custom UITableViewCell: SListViewCell * cell = nil; // cell = [listView dequeueReusableCellWithIdentifier:CELL]; if (!cell) { cell = [[[SListViewCell alloc] initWithReuseIdentifie...

Show Detail

update UITableViewCell when UICollectionViewCell is selected

I am creating a project where I have a lot of options for user to select among different plans. So I created a UITableViewCell, put UICollectionView inside with one UICollectionViewCell as one pla...

Show Detail

update content of custom UITableViewCell not working

I am creating a custom UITableViewCell as in http://www.e-string.com/content/custom-uitableviewcells-interface-builder all is working fine with no problem. The loading of data is correct, which p...

Show Detail

Update UITableViewCell label using UITextViewDelegate

I am trying to update a UITableViewCell dynamically from a UITextField by using the UItextfields delegate, however it's always a character behind. So if I type the letter h into the UITextView not...

Show Detail

How to update only one element of UITableViewCell?

I am trying to update only one element of a programmatically created UITableViewCell without updating the entire table or the entire cell. Here is a part of my code: These is how I am adding

Show Detail

KVO update UITableViewCell

I have a ViewControllerA that you can download files using AFNetworking and setDownloadProgress to update my model with the progress. I also have ViewControllerB that has a UITableView with a list ...

Show Detail

UIDatePicker in UITableViewCell update UITableViewCell textlabel

I have been going through the processes of setting up a UIDatePicker in a UItableViewCell that is revealed when selected a UITableViewCell above it then collapses when you select any other

Show Detail

globally update all uitableviewcell

I'm working on a Dark mode for an application. The basic premise to have a toggle allowing users to switch between a dark and a light mode. I'm trying to figure out the best way to update all

Show Detail

Swift how to proper update UITableViewCell constraint

I wonder how I proper update a tableviewcell constraint? In my app I am checking if the user is using a iphone 6/7 or iphone 6/7 Plus and depening on that I have to change some constraints. I hav...

Show Detail