Should I have a NSFetchedResultsController in every view?

前端 未结 2 794
难免孤独
难免孤独 2021-02-03 11:47

I\'m using Core Data in my first iPhone application and trying to understand NSFetchedResultsController. It works great in my root view. Do I need to instantiate an instance in

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 12:09

    I'd like to add that if you are using multiple NSFetchedResultsControllers for the same entity, but in different tables, your UITableView will not update if you insert data for the same entity using another controller. This is because your UITableView will not receive willChangeContent ,etc messages from an NSFetchedResultsController for which you have not set yourself as a delegate.

提交回复
热议问题