• 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: CoreData: get/set methods in undo and flushing of caches
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData: get/set methods in undo and flushing of caches


  • Subject: Re: CoreData: get/set methods in undo and flushing of caches
  • From: Frank Illenberger <email@hidden>
  • Date: Fri, 24 Jun 2005 22:22:21 +0200


today I noticed, that the get and set methods in a subclass of  

NSManagedObject are only called when I directly enter a value from  

the bound NSTextField. They are not called again when I press the  

undo button to restore earlier values. The problem now is: When the  

set methods are called, they flush a certain cache that is  

connected to the attribute. When the method is not called during an  

undo, I am not able to correctly flush my cache. What would be the  

best pratice to deal with this? Does every object of this class has  

to observe itself to get a clue when to flush the cache?



Is there any reason you cannot make the cached attribute a transient  

attribute of the entity?  If you do this, undo is handled  

automatically.  (See <http://developer.apple.com/documentation/Cocoa/ 

Conceptual/CoreData/Articles/cdNSAttributes.html for relevant  

principles.)



Malcom, 
you are right that in most cases it works to setup the caches in a transient attribute and leave it to the built in undo mechanism to get them right. But in my case my caching mechanism needs to open and close files according to the state of an attribute so I need to track the setting and resetting of the attribute.

Frank

 _______________________________________________
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

  • Prev by Date: Implement a browser like 'back' feature
  • Next by Date: Re: Converting point struct from superview to subview (SOLVED)
  • Previous by thread: Re: CoreData: get/set methods in undo and flushing of caches
  • Next by thread: Disturbing Control Problem in Tiger
  • Index(es):
    • Date
    • Thread