split view/pop-over maintaining selection
I am implementing my own split view. Exact behavior intended as the inbuilt split view controller. On device rotation the split pane vanishes and a popover button comes up on top (containing the tableview controller I have wired as the master view, and the entire screen dedicated to detail view) and vice versa for the other rotation case(master appears again on left side and detail view o开发者_高级运维n right side).
The issue is I'm having trouble maintaining the row selection on the master view. On rotating the device I lose the selection information as to which row was selected in the master tableview. I need to retain the row selection and the highlighting as well in the master view and the popover on rotations.
Any broad hints would be greatly appreciated. Thanks
Solved.
[self.tableView reloadData];
and the method call:
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:inSection:] animated: scrollPosition:];
does the needful. Needs to be rightly placed in viewDidAppear/ViewDidLoad and rotation methods to handle all cases.
精彩评论