I'm putting custom colors into table cells that can change on circumstances. The code below changes the color back and forth fine. I don't like the fact that have to do a reloadData
every time to get the colors to show up. Is there a less expensive way to force a cell color update?
There is other code here that has been stripped out.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// testing for old selected color
if (checkedIndexPath)
{
// returning old checked cell back to blue
UITableViewCell *uncheckCell = [tableView cellForRowAtIndexPath:checkedIndexPath];
uncheckCell.backgroundColor = [UIColor blueColor];
}
// changing selected cell background color
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.backgroundColor = [UIColor greenColor];
checkedIndexPath = indexPath;
// reloadingtable data
[self.tableVerseView reloadData];
}