Re: Core Data: Primitive Accessors & Ivar-Backed Properties
Re: Core Data: Primitive Accessors & Ivar-Backed Properties
- Subject: Re: Core Data: Primitive Accessors & Ivar-Backed Properties
- From: Mike Abdullah <email@hidden>
- Date: Wed, 18 Sep 2013 17:02:02 +0100
On 18 Sep 2013, at 16:45, Keary Suska <email@hidden> wrote:
> On Sep 17, 2013, at 4:30 PM, Keary Suska wrote:
>
>> I hadn't considered the undo issue--I guess I just thought undo support was "automagical". If not, are you aware of whether it is implemented at the public or primitive accessor level? None of the doc examples I have seen do any undo handling...
>
> Figured it out--looks like undo is handled as a result of willChange/didChange.
Yep, undo handling is built atop Core Data's general change tracking, which relies on KVO. It's worth noting that under typical circumstances, the public accessor method fires a KVO notification to get the undo op registered. But when an undo or redo actually happens, Core Data calls directly through to the primitive setter method so as to avoid any side-effects.
_______________________________________________
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