Is there any way to access the owning UITableView
from within a UITableViewCell
?
Is there any way to access the owning UITableView
from within a UITableViewCell
?
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.