Reload tableView after dismiss a viewController

前端 未结 5 955
遇见更好的自我
遇见更好的自我 2021-02-14 14:05

I have a ViewController(VCA) with a TableView inside. From this ViewController it is possibile to call another ViewController (VCB). In this second VC it is possibile add an ite

5条回答
  •  失恋的感觉
    2021-02-14 14:36

    The code in your question is perfectly good. I use the same approach and it works like a charm. IMHO the problem in your code is that you only refresh the table view with self.tableView.reloadData(), BUT may be you forget to refresh your data model - the data source for the table view. E.g. if you delete an entity from Core Data then you need to refetch your data and only after that reload the table view.

提交回复
热议问题