ios – Appropriate steps to reload tableview utilizing tableView.reloadRows for various rows

[ad_1]

I’ve tableview that has part header view. Part header consists of assortment view. Clicking on objects of assortment view outcomes api callig and reloading tableview part reload by tableView.reloadSections(). Nonetheless my aim is to make use of tableView.reloadRows() to skip part view realoding. However that method I get exception like objects depend doesn’t match to previous worth of dataSource.
What I’m doing is

  1. laoding knowledge and populate desk with knowledge (so there are two rows)
  2. then fetching knowledge by cklicking merchandise in header (there is only one document/row)
  3. empty my datasource and fill with new knowledge
  4. beginning tableView.roladRows() for every merchandise in dataSource (which has only one merchandise now)
  5. get exception

If I’m not mistaken dataSource merchandise depend has match to previous worth if there isn’t any insert and delete operation. Nonetheless I do not undestand this logick and what I’m lacking in my algorithm conserving in thoughts that technique sectionCount, numberOfRowsInSection return values based on dataSource.

What are the proper steps to reload tableview utilizing simply tableView.reloadRows() for various depend of rows on eahc reload itertion?

Utilizing tableView.reloadSections() goes positive however I would like to make use of tableView.reloadRows()

[ad_2]

Leave a Reply