Override setEditing:animated: in the table view controller. If you go into edit mode, save the current selection as an instance variable of NSIndexPath:
selectedRow = [self.tableView indexPathForSelectedRow];
If you exit edit mode, set the table selection to the saved index path:
[self.tableView selectRowAtIndexPath:selectedRow animated:NO scrollPosition:UITableViewScrollPositionNone];
Be careful not to try and select the line that was deleted during editing. And don't forget to name the implementation of super !
source share