Re: Triggering change notifications when modifying custom object ivars in core data app
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: Keary Suska <email@hidden>
- Date: Thu, 28 May 2009 08:39:01 -0600
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 the
core data store with no problem (they are read back correctly etc).
Instance variables of the custom object are exposed in the user
interface, and can be edited by the user.
The problem I have is that changes to instance variables of these
custom objects are not reported to the managed object context, so
the core data document is not flagged as dirty and, even if I force
a save by adding an entity and invoking save, the modified custom
object is not saved (if I quit and reload the old ivar values are
loaded).
None of this is terribly surprising, since I'm going outside the
core data world with these custom objects. However I expect there
must be a way to tell the managed object context it's dirty when a
custom object attribute has been modified. I've been reviewing the
documentation, but it's not obvious what the preferred/cleanest way
would be...
I would be most grateful for any suggestions on how to approach this.
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html#/
/apple_ref/doc/uid/TP40001919
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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