What is the benefit of calling beginUpdates/endUpdates for a UITableView as opposed to not doing so?

后端 未结 1 1715
悲哀的现实
悲哀的现实 2020-12-25 15:07

I have an array of arrays that I\'m using for the data source of a table view. In one instance of time, I may have to do some complicated modifications to this data structur

相关标签:
1条回答
  • 2020-12-25 15:35

    Every time you add/remove a table item the tableView:numberOfRowsInSection: method is called - unless you surround these calls with begin/endUpdate. If your array and table view items are out of sync, without the begin/end calls an exception will be thrown.

    0 讨论(0)
提交回复
热议问题