How to perform a cell deselection when a user returns to a table view?
- by Panagiotis Korros
I am using a UITableView to display a list of cells, when the user selects a cell then a new view appears by using the following code:
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.navigationController pushViewController: detailsViewController animated: TRUE];
}
By using the code above, the view is displayed correctly, but when I return back to the root table view, then the cell is still selected.
I noticed, in many sdk examples, that the cell is deselected (with a nice animation) when the root view is poped pack, but I could not find the code that implemented this feature in any of the examples.
I know that I can use:
[tableView deselectRowAtIndexPath:indexPath animated: YES];
to implement this, but I am very curious on how these examples do it without using any code.
Any ideas?