Reference from UITableViewCell to parent UITableView?

前端 未结 7 1727
有刺的猬
有刺的猬 2020-11-29 04:02

Is there any way to access the owning UITableView from within a UITableViewCell?

7条回答
  •  暖寄归人
    2020-11-29 04:43

    UITableView *tv = (UITableView *) self.superview.superview;
    UITableViewController *vc = (UITableViewController *) tv.dataSource;
    

提交回复
热议问题