美文网首页
tableView delete/insert时必须begin&

tableView delete/insert时必须begin&

作者: wustzhy | 来源:发表于2020-03-02 10:00 被阅读0次

    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;
    ...
    

    相关文章

      网友评论

          本文标题:tableView delete/insert时必须begin&

          本文链接:https://www.haomeiwen.com/subject/ptwrkhtx.html