检测UITableViewCell何时超出范围 [英] Detect when UITableViewCell goes out of scope

查看:129
本文介绍了检测UITableViewCell何时超出范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I detect when a UITableViewCell derived object gets removed from a table and into the cache?

推荐答案

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

Implement either of the following methods. When removed from the table, superview will become nil. When added back to the table, superview will be set to the table view.

- (void)willMoveToSuperview:(UIView *)newSuperview;
- (void)didMoveToSuperview;

另见

- (void)prepareForReuse;

这篇关于检测UITableViewCell何时超出范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆