Hi!

I think mergeChangesFromContextDidSaveNotification: does not work as most 
people expect:
I have a mainthread and a subthread. My subthread updates a managed object 
(change one of the property value) and save.
In the mainthread, I use [mainThreadContext 
mergeChangesFromContextDidSaveNotification:subThreadNotification]; and it 
merges the main thread context as expected (binded UI is updated)

What is not expected is :

1/ asking the main thread for its updatedObjects (just after the 
mergeChangesFromContext... but before the save:) does not show the changes made 
in the subthread! So updated objects in subthread are not seen as updated in 
the main thread after the mergeChangesFromContext call!
2/ Saving the main thread generates a did save notification, that does not 
contain changes made in the subthread (and merged) !

The subthread is temporary (does it job in an NSOperation that terminates 
quickly), its context is also temporary. 

In the mainthread, *many* controllers are observers of the did save 
notification of the main thread context. How am I supposed to make them listen 
to changes made in a temporary, dumb, subthreaded managed context without using 
mergeChangesFromContext... call ???

I'm pertty sure, most developers expect the 
mergeChangesFromContextDidSaveNotification: API to really merge the data in the 
main thread context and set the merged updated objects as *really* updated, as 
if the change really occured in the main thread!

Aurélien,
Objective Decision Team

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to