• 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
Re: awakeFromInsert called twice with nested contexts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: awakeFromInsert called twice with nested contexts


  • Subject: Re: awakeFromInsert called twice with nested contexts
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 27 Nov 2011 21:23:18 -0800

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

  • Follow-Ups:
    • Re: awakeFromInsert called twice with nested contexts
      • From: Kyle Sluder <email@hidden>
References: 
 >awakeFromInsert called twice with nested contexts (From: Tom Harrington <email@hidden>)
 >Re: awakeFromInsert called twice with nested contexts (From: Jerry Krinock <email@hidden>)
 >Re: awakeFromInsert called twice with nested contexts (From: Roland King <email@hidden>)
 >Re: awakeFromInsert called twice with nested contexts (From: Tom Harrington <email@hidden>)
 >Re: awakeFromInsert called twice with nested contexts (From: Quincey Morris <email@hidden>)
 >Re: awakeFromInsert called twice with nested contexts (From: Tom Harrington <email@hidden>)

  • Prev by Date: Re: awakeFromInsert called twice with nested contexts
  • Next by Date: Re: awakeFromInsert called twice with nested contexts
  • Previous by thread: Re: awakeFromInsert called twice with nested contexts
  • Next by thread: Re: awakeFromInsert called twice with nested contexts
  • Index(es):
    • Date
    • Thread