UITableView: Header below a section gets duplicated if a row is deleted from the section above
- by Megasaur
In the editing mode of one of my tableviews, I delete a row from a section. The section below has a header. The deletion of the row in the section above leads to duplication of the section header below. So I have 2 header titles, one above the other.
I also tried forcing a reload of the section after the delete to no avail:
[self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
NSIndexSet * indexSet = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(3,1)];
[self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade];
[indexSet release];
[self.tableView endUpdates];
Any ideas of what I have done wrong?
It is also interesting that the header that failed to get removed is not "seen". If I scroll right off the content of the table view, and let it snap back, only the top header view is seen. It always ignores the header that should have been removed.