私がやっていることは、私のsearchResultsTableViewでselectRowAtIndexPathを呼び出すことです。私はviewWillAppearでこれをやっているので、別のView Controllerから戻ってきた行が選択されます。この単純な例では、2行目に行くように求めています。何が起こるかは、2行目を短く選択してから選択肢がなくなるということです。何か案は?私のsearchController.searchResultsTableViewのselectRowAtIndexPathを呼び出しようとしています
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// just select row 2 as a test
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:2 inSection:0];
[self.searchController.searchResultsTableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[self.searchController.searchResultsTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:NO];
}
おかげ
パーフェクト!どうもありがとうございました。エリック –