Delete UITabelview and UITabelview
Self. tableView ?. DeleteRowsAtIndexPaths ([indexPath, indexPath1], withRowAnimation:. Left) // title is the data source self. titles. removeAtIndex (0) self. titles. removeAtIndex (0)
2016-07-30 21:44:26.613 UITableViewLearn[14976:575144] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (4) must be equal to the number of rows contained in that section before the update (4), plus or minus the number of rows inserted or deleted from that section (0 inserted, 2 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
UIKit is calleddeleteRowsAtIndexPaths
The data source consistency is determined. If the data source is inconsistent, an exception is thrown. However, it only determines whether the number of cells is consistent. If you delete data in columns 0th and 1 and then delete cells in columns 2nd and 3, no error is reported.
Let indexPath = NSIndexPath. init (forRow: 2, inSection: 0) let indexPath1 = NSIndexPath. init (forRow: 3, inSection: 0) // title is the data source self. titles. removeAtIndex (0) self. titles. removeAtIndex (0) self. tableView ?. DeleteRowsAtIndexPaths ([indexPath, indexPath1], withRowAnimation:. Left)
No error is reported.