Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Inconsistent UITableViewCell state #94

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

Inconsistent UITableViewCell state #94

jparishy opened this issue Jan 11, 2012 · 2 comments

Comments

@jparishy
Copy link

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
Copy link

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
Copy link
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants