• 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: willChangeValueForKey, Ivars and Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >willChangeValueForKey, Ivars and Core Data (From: Scott Ahten <email@hidden>)
 >Re: willChangeValueForKey, Ivars and Core Data (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: willChangeValueForKey, Ivars and Core Data
  • Next by Date: Re: Proper way of ending text field editing on Quit
  • Previous by thread: Re: willChangeValueForKey, Ivars and Core Data
  • Next by thread: Re: willChangeValueForKey, Ivars and Core Data
  • Index(es):
    • Date
    • Thread