Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在一个UIView中选择多个UITableView中的行_Ios_Xcode_Uitableview - Fatal编程技术网

Ios 在一个UIView中选择多个UITableView中的行

Ios 在一个UIView中选择多个UITableView中的行,ios,xcode,uitableview,Ios,Xcode,Uitableview,我在一个UIView中有多个UITableview 我如何实现以下目标: 如果在一个表中选择了一行,则其他表中的行将被删除 也被选中了 这将进入didSelectRowAtIndexPath方法吗?只需使用tableView参数: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 所以,您只需比较tableView变量: if (tableView == sel

我在一个
UIView
中有多个
UITableview

我如何实现以下目标:

如果在一个表中选择了一行,则其他表中的行将被删除 也被选中了


这将进入
didSelectRowAtIndexPath
方法吗?

只需使用tableView参数:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
所以,您只需比较tableView变量:

if (tableView == self.tableView1)
...
else if (tableView == self.tableView2)
...

委托本身返回执行操作的tableview引用 因此,要检查设置tableview的出口并进行比较,以找到执行了哪个tableview操作

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

这里的
tableView
是操作发生的表

我可能误解了这个问题,因为有三个关于找出使用哪个表视图的答案。但是您想要的是在所有表视图中选择同一行,不是吗? 然后使用:

–选择Rowatindexpath:animated:scrollPosition:


对于
didSelectRow:atIndexPath:

中的所有表视图,您可以在-(void)tableView:(UITableView*)tableView didselectrowatinexpath:(NSIndexPath*)indexPath方法中显示代码吗?您希望只显示一个选择或执行一个操作。如果要执行某个操作,那么这种方法会造成混乱。哦,我正试图实现一个gridtable,所以我创建了多个TableView,,我想我必须改变方法..为了实现Grid Table:尝试是的,所有表中都有相同的行..很抱歉现在出现了混乱,我可以将它们全部滚动。,,我也想在他们那一排做,我不知道你的意思。你能解释一下吗?