TableView doesn't update(reloadData) after CoreData change using FRC Swift 3

前端 未结 2 553
醉梦人生
醉梦人生 2021-01-28 02:26

I have updated this question as I found another key to this problem. It seems that when I add something to CoreData, the tableview does not reload the data, even though I can pr

2条回答
  •  不要未来只要你来
    2021-01-28 03:00

    • To do this you can simply add fetchedResultsController.delegate = nil in viewWillAppear function before calling table reloadData.

    override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    fetchedResultsController.delegate = nil
    self.tableView.reloadData()
    }

提交回复
热议问题