I've got a UITableView
that when selecting a UITableViewCell
I call a web service to fetch new data and then reload the UITableView
with the new data.
Now, the selected row will always be part of the new data that comes back. However the number of rows in a section won't be constant.
I am trying to keep selection on the row that was selected after I reload the table view. I saved the indexPath from didSelectRowAtIndexPath
. However when I call:
[self.tableView selectRowAtIndexPath:self.selectedIndexPath
animated:NO
scrollPosition:UITableViewScrollPositionNone];
Nothing happens and my row I selected is no longer selected after the reload. Is there anyway to keep selection after a reload of UITableView
?