• 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: Triggering change notifications when modifying custom object ivars in core data app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Triggering change notifications when modifying custom object ivars in core data app


  • Subject: Re: Triggering change notifications when modifying custom object ivars in core data app
  • From: Dave Fernandes <email@hidden>
  • Date: Thu, 28 May 2009 21:54:38 -0400


On May 28, 2009, at 2:16 PM, Quincey Morris wrote:

Well, yeah. The problem is that you're using something with the behavior of an entity (your custom object) as an attribute. That is, you want your object graph to include your custom objects (for the purpose of monitoring their changes), but you haven't implemented your data model that way. Typically, Core Data *attributes* are immutable (like NSNumber or NSString) for exactly that reason. The mutability of your custom object suggests that it should be an entity, not an attribute. [Sorry, not sure if that's clear. I'm trying to say the same thing 3 different ways.]

Is there a reason you can't make your custom object a Core Data entity, and expose its properties (the troublesome instance variables) as attributes of that entity?

It's not impossible that the willChange/didChange approach can be made to work, but this sort of thing tends to really crap out in the face of undo. Consider what happens when you change an instance variable of a custom object, if the object is already in the undo history from a previous change. Suddenly, undoing changes ... won't.

Good point! _______________________________________________

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


References: 
 >Triggering change notifications when modifying custom object ivars in core data app (From: Rick Hoge <email@hidden>)
 >Re: Triggering change notifications when modifying custom object ivars in core data app (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Hiding process list app icon for GUI apps
  • Next by Date: Re: Regarding SavePanel in NSDocument
  • Previous by thread: Re: Triggering change notifications when modifying custom object ivars in core data app
  • Next by thread: sending continues NSImage data to iPhone
  • Index(es):
    • Date
    • Thread