Hi,
Everyone keep writing about deleting a section. Well, I can't seem to get one added.
Currently, I am trying like this (which fails with NSInternalInconsistencyException):
UITableView *tv = (UITableView *) self.tableView;
if ([tv numberOfSections] == 1)
{
[tv beginUpdates];
[tv insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationTop];
NSLog(@"Inserted.. Brace for impact.");
[tv endUpdates];
}
NSLog(@"Section count after update: %d", [tv numberOfSections]); // Never reached
If I am correct, inserting a section with index 0 should place it at the top, bumping all the other sections down, right? Well, if I write out the numberOfSections right after the insertSections, there appears to be no change in the number of sections.
Any ideas?
Johan