NSFetchedResultsController crashing on performFetch: when using a cache

后端 未结 12 2130
迷失自我
迷失自我 2020-12-23 14:05

I make use of NSFetchedResultsController to display a bunch of objects, which are sectioned using dates. On a fresh install, it all works perfectly and the objects are displ

12条回答
  •  轮回少年
    2020-12-23 14:08

    Straight from the documentation for NSFetchedResultsController:

    Modifying the Fetch Request

    You cannot simply change the fetch request to modify the results. If you want to change the fetch request, you must:

    1. If you are using a cache, delete it (using deleteCacheWithName:). Typically you should not use a cache if you are changing the fetch request.

    2. Change the fetch request.

    3. Invoke performFetch:.

提交回复
热议问题