Ios 手动触发单元格选择表视图
我需要以编程方式手动触发tableView上的单元格选择。基本上运行预先生成的函数Ios 手动触发单元格选择表视图,ios,uitableview,ios5,Ios,Uitableview,Ios5,我需要以编程方式手动触发tableView上的单元格选择。基本上运行预先生成的函数 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 我这样做是为了当一个项目从tableView中删除时,它会自动加载下一个项目。但是,当我尝试手动调用此函数时,似乎找不到它。我试过了 self.tableView: didSelectRowAtIndexPath 及 但两者都没
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
我这样做是为了当一个项目从tableView中删除时,它会自动加载下一个项目。但是,当我尝试手动调用此函数时,似乎找不到它。我试过了
self.tableView: didSelectRowAtIndexPath
及
但两者都没有得到承认
[self tableView:self.tableView didSelectRowAtIndexPath:selectedIndexPath];
用下一行的内容替换selectedIndexPath
确保self是您的表视图委托
编辑:我知道这是一个老问题,但实际上这应该用
[tableView SelectRowatineXpath:path动画:是滚动位置:UITableView滚动位置中间]代码>您应该尝试:
[self tableView:self.tableView didSelectRowAtIndexPath:YourIndexPath]
如何选择下一个indexPath,例如,如果选择了第1行,我想选择第0行,您可以使用[NSIndexPath indexPathForRow:whateverRow Instition:WhateOverSection]创建索引路径;对行和节使用您喜欢的任何逻辑
[self tableView:self.tableView didSelectRowAtIndexPath:YourIndexPath]