获取cell中的Button所在cell的IndexPath

xiaoxiao2025-07-12  6

注:superview的个数需按button所在层级来决定

 

   ProcessTableViewCell *mycell =(ProcessTableViewCell *)[[[btn superview]superview]superview] ;

    // 获取cell的indexPath

    NSIndexPath *myIndex = [self.tableView indexPathForCell:mycell];

    NSLog(@"myIndex.section==%ld",myIndex.section);

    NSLog(@"myIndex.row==%ld",myIndex.row);

转载请注明原文地址: https://www.6miu.com/read-5032973.html

最新回复(0)