动态删除或许插入xib中静态TableView的Cell

动态删除或者插入xib中静态TableView的Cell

图解:

动态删除或许插入xib中静态TableView的Cell

动态删除或许插入xib中静态TableView的Cell

插入方法:

[_tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];

很容易出错:numberOfRowsInSection 没有减1 导致出错:

*** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:1070

libc++abi.dylib: handler threw exception