Core Data does not react on changed predicate

前端 未结 1 1693
轮回少年
轮回少年 2020-12-07 05:30

This is a strange issue.

In my view controller SpieleOrtTVC I am going to present a subset of the objects of the entity Spiel. Every time

相关标签:
1条回答
  • 2020-12-07 06:07

    From the NSFetchedResultsController reference:

    Important: If you are using a cache, you must call deleteCacheWithName: before changing any of the fetch request, its predicate, or its sort descriptors. You must not reuse the same fetched results controller for multiple queries unless you set the cacheName to nil.

    So the problem in your case is that the FRC re-uses a cache that was created for a different predicate. Either don't use a cache (cacheName:nil) or delete the cache before the new FRC is created. In your situation, a cache probably does not make much sense.

    0 讨论(0)
提交回复
热议问题