Dear list,

I'm trying to understand what happens regarding undo/redo when an item 
(NSManagedObject) is removed from a NSTreeController. In particular I have an 
NSManagedObject subclass which has properties which are not part of the core 
data model, but are instead (in some sense) transient. For example, one 
property is an NSTextStorage which I create in awakeFromFetch:. At the moment, 
I have to release the NSTextStorage just before I remove the item from the 
tree-controller. I rather expected (perhaps wrongly) that removing the item 
from the tree-controller (which is bound to the managed object context) would 
result in the particular NSManagedObject being released, but I don't see that 
happening. I also checked to see if didTurnIntoFault: is called on the item, 
but it isn't. My main problem is that, when I undo the removing of items from 
the tree, I need to reinstate the transient properties like the text storage. 
When I undo, awakeFromFetch: isn't called, neither is awakeFromInsert:. So 
where does one get the chance to 'handle things' after an undo? I saw in the 
documentation the method awakeFromSnapshotEvents: but there it says "Available 
in iPhone OS 3.0 and later". What about if I'm developing for 10.5?

Many thanks in advance for any insights that anyone can offer.

Best wishes,

Martin


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
    Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to