as the project needs, do a UITableView to implement the delete function. the 1.TableView is grouped. 2. After clicking the Delete button, a row is deleted. appears:
[uitableview_endcellanimationswithcontext:],/sourcecache/uikit_sim/uikit-2372/uitableview.m:1070
Libc++abi.dylib:handler threw exception
Reason:
1. Before calling the deleterowsatindexpaths: method, make sure the data is up to date. In other words, the data to be deleted is removed from the data source first.
2. Grouping and grouping the number of rows is variable and cannot be written as dead!
3. If you are grouping, you will find strange phenomenon: When a group, there are multiple data, you delete one of the, correct; When a group, you want to delete the only one, you will still report the error as above!
When you delete the last piece of data in a group, the number of groups, and the number of rows, changes. At this point, only the deleterowsatindexpaths method is called. That is, only the number of rows is manipulated, but the grouping of changes is not manipulated!
Check out the Help API to find such a method:deletesections: Method!
Plus go, delete the group as you delete the last record in a group!
[UITableView _endcellanimationswithcontext:]