Re: Detecting Managed Object Property Change From Undo Redo
Re: Detecting Managed Object Property Change From Undo Redo
- Subject: Re: Detecting Managed Object Property Change From Undo Redo
- From: Jerry Krinock <email@hidden>
- Date: Sun, 25 Jan 2015 15:16:16 -0800
On 2015 Jan 25, at 01:20, Mike Abdullah <email@hidden> wrote:
> You are mistaken. Core Data *does* fire KVO notifications during undo/redo.
Although I wasn’t aware of this, I just did a little experiment and found that Mike is correct…
http://youtu.be/PUHBAq-Me_4
On 25 Jan 2015, at 06:35, Richard Charles <email@hidden> wrote:
> The only solution seems to be to use custom primitive accessors that have change notification. What am I doing wrong?
I would not override the primitive accessors; instead I would override the regular accessors, or if you are using mogenerator, that has already been done for you.
The reason I had to run that test is because I don’t use KVO for observing managed object properties. Instead, I use NSNotificationCenter, which has these advantages…
• Amount of code required is the same or less
• Ability to coalesce and filter notifications per object or name
• When an observer is being torn down you can remove all observers with one line of code,
[NSNotificationCenter removeObserver:self].
With KVO, if I recall correctly, you need to remember and remove each observance, arghhhh.
Just my two cents. There are many ways to do this.
_______________________________________________
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