iphonecellselectionthree20

Clear selection of TTTableViewController when view appears


I can't seem to find a way to clear a TTTableViewController's selected cell after returning from the previous view. Anyone got any advice?


Solution

  • TTTableViewController is a subclass of UIViewController so you can use the @property(nonatomic) BOOL clearsSelectionOnViewWillAppear property and set is to TRUE

    If this does not work you can always deselect the row with

    [self.tableView deselectRowAtIndexPath:[self.view indexPathForSelectedRow] animated:YES];
    

    where self.tableView is your TableView. Putting this line in your viewWillAppear should work.