Wrong Editing Controls Displayed in UITableView

Posted by CJC on Stack Overflow See other posts from Stack Overflow or by CJC
Published on 2010-05-25T16:36:10Z Indexed on 2010/05/25 16:41 UTC
Read the original article Hit count: 195

Filed under:
|
|

Hi all,

I'm having a strange problem with UITableView. When the user taps the Edit button, the tableview (which is a grouped view with multiple sections) is supposed to show delete buttons for each row--except for the final row in each section, which has a green add button.

When a user taps the green button, a new row is inserted, but now the final row gets a delete button. Even stranger, that delete button ACTS like an add button. So it seems there's a drawing glitch, rather than a problem in assigning the correct style. (Extensive NSLogging shows that the last cell is getting the Insert editing style correctly.)

I've tried setting setNeedsDisplay on the cell and the tableView, I've tried reloading that section/row/the entire table, but the issue persists. Any ideas on how to get UITableView to explicitly redraw the editing controls?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview