How to get UITableViewCell indexPath from the Cell?

后端 未结 11 1636
野趣味
野趣味 2020-12-07 20:11

How do I, from a cell, get its indexPath in a UITableView?

I\'ve searched around stack overflow and google, but all the information is on t

11条回答
  •  半阙折子戏
    2020-12-07 20:21

    Try with this from your UITableViewCell:

    NSIndexPath *indexPath = [(UITableView *)self.superview.superview indexPathForCell:self];
    

提交回复
热议问题