ios - NSInternalInconsistencyException error removing tableview cell -


i'm getting nsinternalinconsistencyexception when trying remove single row table view. table view contains several sections, 1 row per section. i'm doing following:

nsindexpath *indexpath = [nsindexpath indexpathforrow:0 insection:index];                 [indexpathtodelete addobject:indexpath]; [self.tableview beginupdates]; [self.tableview deleterowsatindexpaths:indexpathtodelete withrowanimation:uitableviewrowanimationfade]; [self.tableview endupdates]; 

before update, i've updated model (a nsarray containing 1 object every row of table view), deleting object @ index.

what doing wrong?

i've checked i'm returning correct number of sections after deleteing object model , table in method -(nsinteger) numberofsectionsintableview:(uitableview *)tableview.

any hints?

since have 1 section per item, need tell table view section has been deleted call deletesections:withrowanimation: inside beginupdates/endupdates block.


Comments