On Nov 27, 2011, at 20:50 , Tom Harrington wrote:

> If they're different objects then I'm getting duplicates, which is at
> least as much of a bug and possibly more so. What I observe is that if
> I add 10 objects, I get 20 calls to awakeFromInsert, 10 for the child
> context and 10 for the parent. But, there are only 10 unique managed
> object IDs. It might be that I just happen to be getting the same IDs
> for two completely different sets of objects, but there shouldn't be
> two sets in the first place.

Objects are specific to a managed object context, so it's correct that there 
would be 20 objects, and it's correct that there would be only 10 object IDs.

For any given "row" in the persistent store, there will be one object *per 
managed context* in memory. The set of objects that correspond to the row all 
have the same object ID -- that's what object IDs are for. All of the numbers 
you're quoting are consistent:

        1 persistent store
        2 managed object contexts
        10 rows to be inserted in the persistent store (when the MOCs are 
eventually saved)
        10 object IDs, one per row
        20 object instances, one per row per managed object 
context_______________________________________________

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