views:

317

answers:

3

I have table with a NSFetchedResultsController datasource and delegate. I have another view controller (only for displaying detail) which can be pushed from the table. However, when the vc is pushed, a call to the NSFetchedResultsController "...didChangeObject" method is received for the "update" type. However, the vc being pushed does not modify, add to or remove from the underlying managed objects or their relationships.

  1. Is there any way I can determine which attribute/property change is triggering the update?
  2. What besides an update, deletion or edit can trigger the NSFetchedResultsController delegate method in question?

Thank you

A: 
  1. I have no idea, I've been looking for information about this but it seems there is no way you can see which attribute has been changed
  2. An item insertion can trigger this delegate method.

You can see sample code on how it is handled when you build up a new Navigation Project and checking the "Use core data" checkbox.

Luzal
+4  A: 

You can register for the "NSManagedObjectContextObjectsDidChangeNotification" Notification (ADC - NSManagedObjectContext documentation)

It does not tell you what caused the update, but it can help to locate the cause.

If you know the responsible entity you can observe each property/relation of the entity for changes. This should definitely locate the source of the update.

Martin Brugger
+7  A: 

The first step of something like this is to create a sample project and try and duplicate the behavior. That will let you:

  1. Post the sample code here for others to examine.

  2. If it turns out to be a true bug then the code is ready to submit to Apple.

  3. If it is not a bug you just solved it yourself.

Marcus S. Zarra