Store a weak
reference to the tableView in the cell, which you'd set in -tableView:cellForRowAtIndexPath:
of your table's dataSource.
This is better than relying on self.superview
to always be exactly the tableView is fragile. Who knows how Apple might re-organize the view hierarchy of UITableView
in the future.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…