ios另一个UITableView中的水平UITableView



我在水平UITableView中的另一个UITableView内有一个按钮。当我点击一个按钮时,应用程序崩溃,并显示消息"无法识别的选择器已发送到实例"。据我所知,问题是另一个类处理tap,但我不知道如何修复它。

我刚刚解决了。也许有人会需要我的解决方案。我移动了

[self.checkBoxButton addTarget:self action:@selector(checkBoxButtonAction) forControlEvents:UIControlEventTouchUpInside]; 

从视图(实际上显示的是该视图,而不是单元格

[cell addSubview:CellView.view];

)到UITableView类到

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

并且改变了一点

[CellView.checkBoxButton addTarget:self-action:@selector(checkBoxButtonAction)forControlEvents:UIControlEventTouchUpInside];

因此,现在tap处理的不是视图,而是uitableview类,一切都很好

最新更新