• 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: My Core Data experiences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My Core Data experiences


  • Subject: Re: My Core Data experiences
  • From: Brian Williams <email@hidden>
  • Date: Tue, 23 Jan 2007 19:41:00 -0800 (PST)

As for problem one below, Apple confirmed that it's a bug. Good to know.


--- Brian Williams <email@hidden> wrote:

> Hi Cocoa-Dev,
>
> In my struggles with Core Data I have discovered some things for my self that
> are not discussed in the documentation. I hope that my experience will save
> someone grief in the future. I would also like to hear other peoples
> solutions
> and please fell free to disabuse me of any spurious ideas.
>
> 1) Life cycle and undo / redo:
>
> The documentation says "It is important to appreciate that Core Data "owns"
> the
> life-cycle of managed objects." It goes on to say that awakeFromFetch and
> awakeFromInsert should be used for any extra setup and then didTurnIntoFault
> should be used in place of dealloc. About didAwakeFromFetch it specifically
> says "awakeFromFetch is invoked when an object is re-initialized from a
> persistent store". While this is all true what is not said is that if you
> undo
> to a time before you managed object existed, didTurnIntoFault will be called,
> but that on redo neither awakeFromFetch nor awakeFromInsert will be called.
> The
> result is that you cannot depend on doing any setup that is not reflected in
> the model. This leads rule one:
>
> All managed object state must be in the model, even temporary values.
>
> So that means that there is no way to reliably setup observers in
> NSManagedObjects, or retain anything for that mater. Maybe it's obvious to
> others, but I got burned on that one.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: My Core Data experiences
      • From: mmalc crawford <email@hidden>
References: 
 >My Core Data experiences (From: Brian Williams <email@hidden>)

  • Prev by Date: [Q] Any constant meaning empty string in the NSSearchField?
  • Next by Date: Setting the application Icon
  • Previous by thread: Re: My Core Data experiences
  • Next by thread: Re: My Core Data experiences
  • Index(es):
    • Date
    • Thread