Hi,
I have a tableView
with multiple sections. When a sections contains only one row, and if I try to delete that row, my app crashes while executing this code :
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
I get this exception :
*** Terminating app due to uncaught exception 'NSRangeException',
reason: '*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'
There is an array for each section. Each one of these arrays contains objects to display in rows. Then there is another array which contains these arrays.
Any idea of what I'm doing wrong ? Thank you.
edit :
OK, I just saw in the debugger that it's the tableView: titleForHeaderInSection
method which was crashing, because I was getting the section's title in the array I just deleted.. So I was trying to access an array with 0 object in it...