Reputation: 4402
Suppose there are 20 items to display in UITableView
. At a time 5 UITableViewCell
are visible. I am adding observer in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
method. Now if user scrolls the table then suppose first row is not visible. So my quesion is how can I remove the observer? Any method will be called when UITableViewCell
is no more visible in UITableView
?
Any help will be appreciated..
Upvotes: 0
Views: 33
Reputation: 2281
Here, here and here you can find the solutions for your problem.
You should use below UITableViewDelegate
method:
- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
Upvotes: 1