As a user scrolls up and down in an uitableview cells get destroyed and created.
Is there a way to detect when a cell is going to be or has been destroyed?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that by “getting destroyed” you actually are referring to a cell getting reused, simply implement
prepareForReusewithin yourUITableViewCellderived class.prepareForReuse
Prepares a reusable cell for reuse by the table view’s delegate.
Discussion
Availability
Available in iOS 2.0 and later.
See Also
– initWithFrame:reuseIdentifier:
@property reuseIdentifier
Declared In
UITableViewCell.h