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

2009-05-28 Thread Rick Hoge
I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to the core data store with no problem (they are read back correctly etc). Instance variables of

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

2009-05-28 Thread Rick Hoge
On 28-May-09, at 10:39 AM, Keary Suska wrote: On May 28, 2009, at 7:03 AM, Rick Hoge wrote: I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to

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

2009-05-28 Thread Dave Fernandes
When the instance variable changes in your custom class, you can call willChangeValueForKey: and didChangeValueForKey: for the entity that contains your custom class. I haven't ever had to do this, but it is the first thing I would try. Dave On May 28, 2009, at 12:34 PM, Rick Hoge wrote:

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

2009-05-28 Thread Rick Hoge
On 28-May-09, at 12:56 PM, Dave Fernandes wrote: When the instance variable changes in your custom class, you can call willChangeValueForKey: and didChangeValueForKey: for the entity that contains your custom class. I haven't ever had to do this, but it is the first thing I would try.

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

2009-05-28 Thread Quincey Morris
On May 28, 2009, at 06:03, Rick Hoge wrote: I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to the core data store with no problem (they are read

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

2009-05-28 Thread Ben Trumbull
Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify entries in this dictionary, and I would like this to cause the context to be flagged as dirty and to have

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

2009-05-28 Thread Sean McBride
On 5/28/09 11:25 AM, Ben Trumbull said: Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify entries in this dictionary, and I would like this to cause the

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

2009-05-28 Thread Rick Hoge
Ben, Quincey, Sean, thanks for the comments. Maybe there are some lower level design issues to rethink. This pattern is usually a flawed model design. If the properties are to be this independently mutable, then there should be a relationship, and/or the complex attribute should be

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

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 11:59 AM, Rick Hoge rickho...@mac.com wrote:  The user can change the input parameters in the object's dictionary of inputs, and this should be reflected in the persistent store of corresponding to the custom attribute on disk.  I realize this is ugly, but I can't think

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

2009-05-28 Thread Rick Hoge
Just a follow-up. It's not perfect, and I'll revisit the design, but it does what I need for now. Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify

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

2009-05-28 Thread Dave Fernandes
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),