Re: core data + undo + to-many relationship
Re: core data + undo + to-many relationship
- Subject: Re: core data + undo + to-many relationship
- From: Mike Abdullah <email@hidden>
- Date: Sun, 7 Dec 2008 11:48:56 +0000
Core Data is specifically designed not to invoke accessor methods when
undoing or redoing changes. For efficiency, it just rolls back the
state of the objects. It does NOT perform the reverse of your original
actions. Of course, during an undo/redo, KVO notifications are fired,
so your UI should be watching out for those in order to update itself.
Mike.
On 7 Dec 2008, at 11:42, John Clayton wrote:
Hi everyone
In a core-data model I have a 'layer' which contains a to-many
relationship to a set of 'effects'. When I add an effect,
everything is working well.
When I use Ctrl-Z to have the undo manager undo the addition of the
effect, then none of my custom accessors are fired (so my GUI
doesn't react) - although the Effect instance faults and is
deallocated (as I can see from my logging).
I thought implementing the accessors: addEffectObject: /
removeEffectObject: and the set variations addEffects: /
removeEffects: on my Layer core-data class was enough to get the
undo management to work in this case - or did I misread the core-
data docs?
Any hints / tips appreciated.
Thanks
--
John Clayton
Skype: johncclayton
_______________________________________________
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
_______________________________________________
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