4thSpace 4thSpace - 1 year ago 73
iOS Question

Why does uitableview cell remain highlighted?

What would cause a tableview cell to remain highlighted after being touched? I click the cell and can see it stays highlighted as a detail view is pushed. Once the detail view is popped, the cell is still highlighted.

Answer Source

In your didSelectRowAtIndexPath you need to call deselectRowAtIndexPath to deselect the cell.

So whatever else you are doing in didSelectRowAtIndexPath you just have it call deselectRowAtIndexPath as well.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
 // Do some stuff when the row is selected
 [tableView deselectRowAtIndexPath:indexPath animated:YES];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download