Iphone 使用UITableViewScrollPositionMiddle:atScrollPosition:时出错,导致我的tableview变得不可滚动

Iphone 使用UITableViewScrollPositionMiddle:atScrollPosition:时出错,导致我的tableview变得不可滚动,iphone,ios,uitableview,nsindexpath,Iphone,Ios,Uitableview,Nsindexpath,我当前正在尝试让我的uitableview自动滚动到所选单元格。。然而,当我现在在tableView:cellForRowAtIndexPath:中使用此方法(如下)时,我已经完成了一半,并且它定义了将uitableview居中到先前选择的indexpath,但是它不允许用户滚动表的其余部分。。它固定在那个位置上 //Center previously ticked cell to center of the screen [self.tableView scrollToRowAtIndexPa

我当前正在尝试让我的uitableview自动滚动到所选单元格。。然而,当我现在在tableView:cellForRowAtIndexPath:中使用此方法(如下)时,我已经完成了一半,并且它定义了将uitableview居中到先前选择的indexpath,但是它不允许用户滚动表的其余部分。。它固定在那个位置上

//Center previously ticked cell to center of the screen
[self.tableView scrollToRowAtIndexPath:oldCheckedData  atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
下面是一个我正在努力实现的例子。

好吧,我错过的一个方法就是解决问题的方法。。。答案是这样的

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    //Center previously ticked cell to center of the screen
    [self.tableView scrollToRowAtIndexPath:yourSelectedIndexMethod  atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
}