views:

401

answers:

2

In my app, when a user touches a table cell, the cell is disabled and the cell's reorder control disappears. If they touch it again, the cell is enabled and the reorder control reappears. The way I'm currently implementing this is by calling reloadRowsAtIndexPaths:withRowAnimation:, but this is sloooowww. If I just change the showsReorderControl property, nothing happens. I had some success with using setEditing:animated:, but it didn't work consistently. Any ideas? Thanks!

A: 

The re-order control should only be visible when the table is in editing mode. To show it for a particular row, you need to implement –tableView:canMoveRowAtIndexPath: in your tableView's datasource. There should be no reason to call -reloadData just to show this control.

Ben Gottlieb
I was using –tableView:canMoveRowAtIndexPath:, but I was missing -tableView:canEditRowAtIndexPath:. Sorry, I should have been more clear about that.
mathew
A: 

Ok, I found a solution. I needed to use -tableView:canEditRowAtIndexPath: in addition to –tableView:canMoveRowAtIndexPath: and then when it came time to show or hide the reorder control, I used the showsReorderControl and setEditing:animated: to get it all working.

mathew