• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreData Application not seeing up-to-date information after store updated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: CoreData Application not seeing up-to-date information after store updated
  • From: Andrew Kimpton <email@hidden>
  • Date: Tue, 13 Nov 2007 01:48:15 -0500

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-)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Creating balloon type of window in Cocoa
  • Next by Date: Re: Crash Reporter for Cocoa Application
  • Previous by thread: Re: help for NSMatrix -> action cell
  • Next by thread: Dynamic UI: can it be done in Cocoa
  • Index(es):
    • Date
    • Thread