crash on deleteRowsAtIndexPaths

前端 未结 5 550
温柔的废话
温柔的废话 2020-11-30 12:46

My application crashes when I\'m deleting row from table. Here is my sources where the bug is detected and stack trace. Thanx!

//delete row from database
- (         


        
5条回答
  •  抹茶落季
    2020-11-30 13:09

    Pretty clear from the error message:

    'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (6) must be equal to the number of rows contained in that section before the update (6), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted).'

    The object you are trying to delete doesn't get deleted in your datasource.
    If I assume that your UITableViewDataSource uses dbManager too, you have to fix dbManager to actually delete the object.

提交回复
热议问题