Hi Kyle,

Actually that's exactly what the doctor ordered (I think).
I had missed this facet of using Core Data in across multiple threads.

So, thank you very much.  I'm sure you have saved me a lot of time.

One last question comes to mind:
As the NSManagedObjectContextDidSaveNotification will be posted on the main thread, is it safe to do a - mergeChangesFromContextDidSaveNotification: on the main thread for any given MOC? My guess is no - unless the MOC has internal synchronisation for all its work that this method also makes use of, then there's nothing to stop the owning thread from updating the MOC while it's being updated in this way. The obvious way to deal with that would be to perform the "mergeChanges" on the owning thread, but that will require an appropriate runloop on each thread.

-- Luke

On 2009-09-21, at 1:31 AM, Kyle Sluder wrote:

Have you remembered to merge changes whenever a thread's MOC posts
NSManagedObjectContextDidSaveNotification?  If the objects which are
seeing the stale properties haven't been faulted out or hit their
staleness interval, you will see this behavior.

Take a look at the NSManagedObject methods
-mergeChangesFromContextDidSaveNotification: and
-refreshObject:mergeChanges: for more info.

--Kyle Sluder


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to