• 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: Detecting Managed Object Property Change From Undo Redo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Detecting Managed Object Property Change From Undo Redo
      • From: Richard Charles <email@hidden>
    • Re: Detecting Managed Object Property Change From Undo Redo
      • From: Kyle Sluder <email@hidden>
References: 
 >Detecting Managed Object Property Change From Undo Redo (From: Richard Charles <email@hidden>)
 >Re: Detecting Managed Object Property Change From Undo Redo (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Crash in libsystem_kernel.dylib`__workq_kernreturn:
  • Next by Date: Re: Crash in libsystem_kernel.dylib`__workq_kernreturn:
  • Previous by thread: Re: Detecting Managed Object Property Change From Undo Redo
  • Next by thread: Re: Detecting Managed Object Property Change From Undo Redo
  • Index(es):
    • Date
    • Thread