CoreData Application not seeing up-to-date information after store updated

  • Running Leopard - I have two applications which share a CoreData
    SQLite persistent store - App A opens the store read only and is
    notified via Distributed Objects when the store has been changed by
    App B (which opens the store in regular read/write mode). App A
    maintains an NSArrayController of 'parent' entities (in this example
    there is only one actual parent instance in the store)

    I have a problem where an instance of the parent object in App A has
    an incomplete (empty) relationship from the to its collection of
    child  managed objects. I know that the child objects are present in
    the store App A is using since i can execute a fetch request in App A
    to retrieve them, when I look at them in App A they all have a valid
    inverse pointer back to the 'parent' object. However that parent has
    no forward relationship to the 'children'. (The inverse child->parent
    relationship is not optional, the parent->child relationship is
    optional however)

    I can see in App B that the relationships are intact and correct both
    before and after ManagedObjectContext is saved.

    I use [NSManagedObjectContext refreshObject:parentObject
    mergeChanges:YES] in App A when the notification that the store has
    been updated is received. I've also tried using the same message with
    a mergeChanges:NO to turn the objects back into a fault - to no avail.

    If I quit and relaunch App A then the parent -> child (and inverse)
    relationships match exactly what was set in App B.

    Can anyone give me some suggestions of other ways to refresh the
    relationships in the parent object in App A ? Is there something else
    I need to do besides using the refreshObject message ? I based my use
    so far on the information in :

    file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html

    in particular the 'Ensuring Data is up-to-date' section.

    Thanks

    Andrew 8-)
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today