Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: should not reset the direction mask #34

Open
gumbright opened this issue Apr 8, 2014 · 1 comment
Open

cleanup: should not reset the direction mask #34

gumbright opened this issue Apr 8, 2014 · 1 comment

Comments

@gumbright
Copy link

In the cleanup: method, the cell's directionMask is set to 0. cleanup: gets called for prepareForReuse as well as dealloc, so you are wiping out a user set value.

@gloubibou
Copy link
Owner

The idea is to set directionMask in -tableView:cellForRowAtIndexPath:
You may want a different value for different rows. In that case it makes no sense to save directionMask across reuse.

I am guessing you want to set directionMask in a subclass rather than setting it on dequeue.
In that case you would need to set it both in the initialized and in prepareForReuse.

All things considered, I see no harm in not clearing directionMask in prepareForReuse. Callers setting a different value for each row on dequeue would overwrite the reused value just the same as the default value.

Please create a pull request.

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

No branches or pull requests

2 participants