Here is a simple scenario: assuming I have two Core Data entities: A
and B
with one to many relationship. (A
can point to many B
).
When creating NSFetchedResultsController
fetching all A
objects, changing a property of any A
object will trigger controllerDidChangeContent
delegate method. However, changing a property of B
object will not trigger this method. (although the changed B
object is referenced by one of the A
objects)
Any idea why?
This took some time to get my head around it. The fetched results controller evaluates the changes of its managed object context. Those changes only fire the fetched results controller delegate methods if they would meet the criteria set for its fetch. This includes matching the predicate conditions.
If your controller is fetching entities of type A, then it will only react to changes of entities of type B if those changes to B affect what is in A (and matching the predicate conditions abd maybe the sort descriptors, as well).
Can you show the predicate in your question above? Can you show the relationships between A and B?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With