iOS get specific UITableViewCell

后端 未结 5 1798
眼角桃花
眼角桃花 2021-01-23 16:55

I have a UIButton in a custom UITableViewCell. This button triggers an event when clicked.

[myButton addTarget:self action:@selector(b         


        
5条回答
  •  情书的邮戳
    2021-01-23 17:40

     UITableViewCell *cell = (UITableViewCell*)[[b superview] superview];
    

    If you added the button on cell as subview then superview of button will be contentView and superview of contentView will UITableViewCell

提交回复
热议问题