Re: willChangeValueForKey, Ivars and Core Data
Re: willChangeValueForKey, Ivars and Core Data
- Subject: Re: willChangeValueForKey, Ivars and Core Data
- From: Scott Ahten <email@hidden>
- Date: Mon, 19 Sep 2005 08:27:18 -0400
On Sep 19, 2005, at 3:52 AM, mmalcolm crawford wrote:
If you don't want the property to be recorded for undo and redo,
don't include it in the model.
mmalc
Ahh.. so the undo events were indirectly causing the document to
think it needed to be saved. I eventually moved this attribute out of
my CoreData model, but wasn't sure why the document was being flagged
as dirty at the time.
However, I went on to say that the document is still flagged as
dirty, even after removing the property from my CoreData model,
creating my own ivar / accessor and performing a clean build.
On Sep 19, 2005, at 1:14 AM, Scott Ahten wrote:
In an attempt to resolve this issue, I've created a ivar for the
attribute in my NSMangedObject subclass and manage it's storage
myself. After creating my own accessor methods, setting this value
no longer marks my document as dirty, but the table column is not
notified of the change. Wrapping the assignment in my accessor
with willChangeValueForKey: and didChangeValueForKey: calls updates
the table, but marks the document as dirty even though this value
is no longer and attribute of my CoreData model and I'm managing my
own storage.
Calling will/didChangeValueForKey on a NSMangedObject subclass seems
to flag it as "dirty" even if the key isn't part of your CoreData model.
- Scott
- - -
:: email@hidden
:: http://www.pixelfreak.net
- - -
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden