I have a UITableView cell – I’m pulling info in from a network, and I have the following delegate method:
-(void)dataReturned:(NSString*)data indexPath:(NSIndexPath*)indexPath
{
MyTableViewCell *currentCell = (MyTableViewCell*)[self tableView:self.tableView cellForRowAtIndexPath:indexPath];
currentCell.someInfo.text = data;
currentCell.smallActivityIndicator.hidden = YES;
}
but unfortunately neither “someInfo” nor the smallActivityIndicator seem to be updated.
Any suggestions as to what I’m doing wrong?
Thanks!
Instead of getting the cell object and updating it, you could update your model with the new data and then call
reloadRowsAtIndexPaths:withRowAnimation:(reference). Reloading a row causes the table view to ask its data source for a new cell for that row.cellForRowAtIndexPath:will get called and it will construct a cell object from the model (which already has the new data).