0

I have a table view displaying few table cells, eg: A, B, C. I also have a button will filter certain cell and display some other cell. Lets say all the cell will use the same instance, although it have been filter or reappear in the table view. It will not initialize again.

The problem is after i click on filter button, the visible cell become A,D,C. when i click on the button on cell "D", the information displayed is belong to "B" which suppose filtered. I tried [table reloadData]; but it still displaying what suppose filtered.

Remarks: The ways i filter is removeAllObject in the tableview, and verify each cell is valid to display on tableview and add each into the tableview again, instead of insert and remove.

user1151874
  • 269
  • 3
  • 5
  • 15
  • what you want to achieve sir? – Jagveer Singh Sep 10 '15 at 04:18
  • I wish to clear cache or prevent when i clicked on the button in cell "D", data from cell "B" display. – user1151874 Sep 10 '15 at 04:36
  • weird thing is the label, and the row belong to "D", but only the button belong to "B". – user1151874 Sep 10 '15 at 11:07
  • http://stackoverflow.com/questions/9592703/labels-are-lingering-in-my-reusable-table-cells/9592750#comment12603441_9592750 i believe my issue is similar with this question. But problem is the instance i am hoping to keep, even though user currently unable to see it. The solution mostly is recommend manually remove the subview from the tablecell, so when it reuse it will not carry the old component with it. But i do not wish to remove it. Any solution to prevent reuse old cell? – user1151874 Sep 10 '15 at 12:21

1 Answers1

0

Hi after you have fliltered your cell you need to change datasource as well and reload tableView. You have not changed dataSource so table still had A,B,C . That's why it's showing information related to B instead of B

Misha
  • 685
  • 8
  • 20