On Wed, May 21, 2008 at 11:36 PM, Dex Morgan <[EMAIL PROTECTED]> wrote:

> This link actions happend in the main thread (so inside the main object
> context) and the app can't see objects inserted into the second
> managedobject until I perform a -save: to it.
> However it seems to be a damn expensive operation (a save for each inserted
> object I mean) and I think it's not the right way to perform my target.

If you need to create relationships between objects in two different
contexts, you need to synchronize those contexts, which is inherently
expensive.

Do you really need to do this after every object inserted? Could you
do it in bulk?

Do you really need to do the inserts on a separate thread? Could you
have your worker thread call
performSelectorOnMainThread:withObject:waitUntilDone: and have the
main thread perform the inserts at the end of each run loop iteration?

Hamish
_______________________________________________

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