Iphone 当UITableViewCell超出范围时检测

Iphone 当UITableViewCell超出范围时检测,iphone,objective-c,Iphone,Objective C,如何检测UITableViewCell派生对象何时从表中删除并进入缓存?实现以下方法之一。从表中删除后,superview将变为零。当添加回表格时,superview将设置为表格视图 - (void)willMoveToSuperview:(UIView *)newSuperview; - (void)didMoveToSuperview; 也看到 - (void)prepareForReuse; 在ios 6.0之后,您有以下UITableViewDelegate方法 - (void)ta

如何检测UITableViewCell派生对象何时从表中删除并进入缓存?

实现以下方法之一。从表中删除后,superview将变为零。当添加回表格时,superview将设置为表格视图

- (void)willMoveToSuperview:(UIView *)newSuperview;
- (void)didMoveToSuperview;
也看到

- (void)prepareForReuse;

在ios 6.0之后,您有以下UITableViewDelegate方法

- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath


Use this method to detect when a cell is removed from a table view, as opposed to monitoring the view itself to see when it appears or disappears.

它在iOS 6.x上不工作。我已经实现了所有3种方法,willMoveToSuperview和didMoveToSuperview只在我第一次滚动tableview时被调用。每次滚动表格视图时都会调用prepareForReuse。因此,无法确定是否已使用前2种方法将单元格从表视图中删除。三。方法在重用它而不是从tableview中删除时被调用。