How do I clear a selection on a table view?

How do I clear the selection on a UITableView within a UIViewController? When using a UITableViewController I would set clearsSelectionOnViewWillAppear to true, but that property isn't available when I am using a UITableView and a UIViewController instead of a UITableViewController.

Answered by NotMyName in 274998022

You have to do it manually--call deselectRow passing in indexPathForSelectedRow, or rows if you have multiple selection enabled.

Accepted Answer

You have to do it manually--call deselectRow passing in indexPathForSelectedRow, or rows if you have multiple selection enabled.

Or you can call [tableView reloadData];

How do I clear a selection on a table view?
 
 
Q