UITableView's cells don't cleanly leave the editing state on reload.

Originator:goodwinlabs
Number:rdar://10962599 Date Originated:01/03/2012
Status:Open Resolved:
Product:iPhone SDK Product Version:5.0.1
Classification:UI Reproducible:Always
 
01-Mar-2012 10:51 AM Samuel Goodwin:
Summary:

UITableView does not disable editing properly on its cells before reusing them.

Steps to Reproduce:

0. We have a table with cells that have a custom editingAccessoryView like so: http://cl.ly/Edfe
1. Once editing is enabled on a given row, tell the table to reload it's data (in our case this is caused by a user selecting a different type of mailbox from the tabs across the top there).
2. Notice that the editing accessory view sticks around for the new cells: http://cl.ly/Ee49

Expected Results:

There should be no blue button in that second screenshot.

Actual Results:

You can see the edge of the blue button in the screenshot.

Regression:

Notes:

I was able to work-around this for now using this:


    [[self.tableView visibleCells] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop){
        if([obj isEditing]){
            [obj setEditing:NO animated:NO];
        }
    }];

before calling -reloadData;

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!