HHPanningTableViewCell icon indicating copy to clipboard operation
HHPanningTableViewCell copied to clipboard

cleanup: should not reset the direction mask

Open gumbright opened this issue 10 years ago • 1 comments

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.

gumbright avatar Apr 08 '14 20:04 gumbright

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.

gloubibou avatar Apr 08 '14 21:04 gloubibou