ios - How to update the UITableViewDataSource when inserting new sections or deleting sections on UITableView? -
i've uitableviewdatasource maintains sections of data items presented uitableview instance. table view editable, allowing insertion , deletion of rows , sections, , changes on view should written data source. after reading through apple documents, can deal insertion , deletion on rows sending message tableview:commiteditingstyle:forrowatindexpath:
data source.
but, however, can't figure out standard way feedback changes on sections data source. please kindly help.
the delegate method tableview:commiteditingstyle:forrowatindexpath:
called table view tell user has done (what have added / removed). responsibility of code make appropriate changes model , reload table view.
the simplest way reload call reloaddata
, , have more specific options reloading / inserting / removing individual rows or sections - ui perspective , table view requires have updated model before call of these methods or table view throw exception.
Comments
Post a Comment