I start with a tableview with one section, the first section always has three rows. After some content has downloaded, I want show a new cell, in a second section, so I do :
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
But I get an NSInternalConsistencyException:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (1), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).'
Why isn't it inserted the new section automatically, If I do insert a section, then I get problems when inserting rows that are not in new sections.
Why can't it just add the new section automatically? surely InsertRowAtIndexpath: also include inserting a section if necessary as an NSIndexPath also includes a section.