Inconsistent UITableViewCell state #94

Closed
jparishy opened this Issue Jan 11, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@jparishy

I have been in the process of adding multiple selection support to the TUITableView and friends classes, and it seems that the cells do not maintain a consisten state, as far as selection is concerned. Setting the boolean ivar selected in UITableViewCell does not stay consistent throughout the drawing process, ie. in drawRect:. I had to test in drawRect: whether or not the indexPath was in the UITableView's list of selected index paths, an ugly hack.

The code is forked on my account; there may be a more elegant way for you to see it but I'm not familiar enough with git or GitHub to know how to do it.

@avaidyam

This comment has been minimized.

Show comment Hide comment
@avaidyam

avaidyam Mar 1, 2012

I'd also like to note that for some reason, the reusable cells are swapping around- back and forth. I tested this by setting a custom background color for each (randomized) and a random int as the title, and they're definitely swapping on drags. Am I doing something wrong, or is this expected?

avaidyam commented Mar 1, 2012

I'd also like to note that for some reason, the reusable cells are swapping around- back and forth. I tested this by setting a custom background color for each (randomized) and a random int as the title, and they're definitely swapping on drags. Am I doing something wrong, or is this expected?

@joshaber

This comment has been minimized.

Show comment Hide comment
@joshaber

joshaber May 11, 2012

Contributor

Cell shouldn't contain state since they can be reused to represent any row. The table view should maintain state per index path and restore it to the cell that represents the index path.

Contributor

joshaber commented May 11, 2012

Cell shouldn't contain state since they can be reused to represent any row. The table view should maintain state per index path and restore it to the cell that represents the index path.

@joshaber joshaber closed this May 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment