• 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
Core Data guidance Was: Calling processPendingChanges from awakeFromInsert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data guidance Was: Calling processPendingChanges from awakeFromInsert


  • Subject: Core Data guidance Was: Calling processPendingChanges from awakeFromInsert
  • From: Brian Williams <email@hidden>
  • Date: Thu, 20 Sep 2007 17:56:48 -0700 (PDT)

Have the core data docs people though about a section specifically explaining
what you should and shouldn't do when and where. Maybe in the context of the
object and document life cycles. Including the gotchas like the side effects of
undo redo etc... I really could have used some architecture guidance with my
first CD projects.

I am tempted to gather a list of such issues and post them somewhere as a "best
practices" guide. However it would be better if someone more qualified would
take on the job.

Brian

--- Tony Becker <email@hidden> wrote:

> Until the awakeFromInsert is finished, the object is "incomplete"
> Calling processPendingChanges flushes (effectively commits) this
> incomplete object to the DB (thats a bad thing)
> Then, after awakeFromInsert, the real object is inserted, which
> appears as a dupe.
>
> You must not call processPendingChanges in awakeFromInsert or
> awakeFromFetch.
> For the same reasons, you can't call executeFecthRequest (which calls
> processPendingChanges), in either of the same awake methods.
>
> Under various conditions, you'll get two objects - and have really
> strange undo problems (even if you don't call the undo registration
> code), which I suspect you're having.
>
> Call your undo registration code after the object is inserted into
> the 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: Core Data guidance Was: Calling processPendingChanges from awakeFromInsert
      • From: mmalc crawford <email@hidden>
References: 
 >Re: Calling processPendingChanges from awakeFromInsert (From: Tony Becker <email@hidden>)

  • Prev by Date: Re: Calling processPendingChanges from awakeFromInsert
  • Next by Date: Re: new class
  • Previous by thread: Re: Calling processPendingChanges from awakeFromInsert
  • Next by thread: Re: Core Data guidance Was: Calling processPendingChanges from awakeFromInsert
  • Index(es):
    • Date
    • Thread