tableView delete/insert时必须begin&

2020-03-02  本文已影响0人  wustzhy

tableView delete/insert cell时注意,必须 调begin&endUpdates,否则就crash

官方参考 Table View Programming Guide for iOS

image.png
- (void)beginUpdates;
- (void)endUpdates;

- (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation;
...
上一篇下一篇

猜你喜欢

热点阅读