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

前端 未结 2 521
醉梦人生
醉梦人生 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条回答
    • 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()
    }

    0 讨论(0)
  • 2021-01-28 03:14

    maybe try this:

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        self.tableView.reloadData()
    }
    
    0 讨论(0)
提交回复
热议问题