gpt4 book ai didi

ios - 如何区分具有相同自定义单元格的两个 UITableView

转载 作者:行者123 更新时间:2023-11-29 11:57:32 24 4
gpt4 key购买 nike

您好,我在一个 UIView 类中有两个 UITableView,并且加载了相同的自定义 UITableViewCell。自定义 tableview 单元格包含一个 UITextField。这意味着两个 UITableView 包含相同自定义单元格的 UITextfield。当我选择该文本字段中的任何一个时,我如何知道选择了哪个 tableView 的文本字段?请帮助我..

最佳答案

UITextField *txt = ----;

txt.superView.superview 将为您提供所需的 UITableView 实例。
更清楚:

UITableViewCell *cell = txt.superView;   // In your case custom cell
UITableView *yourTable = cell.superView;

关于ios - 如何区分具有相同自定义单元格的两个 UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38391187/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com