简体   繁体   English

另一个UITableView内的iOS水平UITableView

[英]ios Horizontal UITableView inside another UITableView

I have a button in horizontal UITableView inside another UITableView. 我在另一个UITableView的水平UITableView中有一个按钮。 When I tap a button application crashes with this message "unrecognized selector sent to instance". 当我点击按钮时,应用程序崩溃,并显示以下消息:“无法识别的选择器已发送到实例”。 As I understand the problem is that another class handles tap but I don't know how to fix it. 据我了解,问题在于另一个类可以处理水龙头,但我不知道如何解决。

I have just solved. 我刚刚解决了。 Maybe someone will need my solution. 也许有人会需要我的解决方案。 I moved 我搬家了

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

from view (actually this view is shown instead of cell 从视图(实际上显示此视图而不是单元格

[cell addSubview:CellView.view]; [cell addSubview:CellView.view];

) to UITableView class to )到UITableView类

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

and changed a little bit 并改变了一点

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

so, now tap handles not a view but uitableview class and everything works fine 因此,现在点击处理不是视图而是uitableview类,一切正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM