I have a UITableViewCell
that observes (via KVO
) some properties. This only makes sense if the cell is visible. I want to remove this observer when the cell scrolls away, and before prepareForReuse
is called.
How can I do this?
I have a UITableViewCell
that observes (via KVO
) some properties. This only makes sense if the cell is visible. I want to remove this observer when the cell scrolls away, and before prepareForReuse
is called.
How can I do this?
Your table view delegate can implement
- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
and in there you can call a method on the cell to perform the cleanup you want.