我想在tableView上使用scrollToRowAtIndexPath。 我正在使用下面的方法。scrollToRowAtIndexPath從另一個線程
當我通過單擊UIBarButtonItem調用此方法時,一切正常,意味着 - tableView滾動就好。但是,當我從另一個線程調用這個方法時,它不會滾動。
想法?
-(void)handleDiffView
{
NSIndexPath * ndxPath;
if (!isLooking) {
ndxPath= [NSIndexPath indexPathForRow:1 inSection:0];
}
else {
ndxPath= [NSIndexPath indexPathForRow:0 inSection:0];
}
[self.tableView scrollToRowAtIndexPath:ndxPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
}