开发者

Detect when UITableViewCell goes out of scope

开发者 https://www.devze.com 2023-01-09 00:17 出处:网络
How can I detect when a UITableViewCell derived object gets re开发者_运维问答moved from a table and into the cache?Implement either of the following methods.When removed from the table, superview will

How can I detect when a UITableViewCell derived object gets re开发者_运维问答moved from a table and into the cache?


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;

Also see

- (void)prepareForReuse;


after ios 6.0 you have the following method of 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.
0

精彩评论

暂无评论...
验证码 换一张
取 消