It's been a while since I messed with my TableViewController so I'm a bit rusty...but now I'd like to set it up so that when a section has zero rows to display (array is empty) then it will "lie" to the controller and return 1 for numberOfRowsInSection. Then in the cellForRowAtIndexPath it will place a UILabel over the one row's cell that says something to the effect of "this section is empty."
Problem is when the table is in editing mode and user deletes the last row I get the following error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 1. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted).
It seems to be upset that after the swipe-to-delete a row when it tries to redraw the table it finds that last row is still there. Where/how should I be handling this? Certainly I'm crapping all over Apple's HIG to some extent but it's confusing to my users to have just a header over an empty section...
thanks!