• 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: Mike Abdullah <email@hidden>
  • Date: Sun, 25 Jan 2015 09:20:53 +0000

> On 25 Jan 2015, at 06:35, Richard Charles <email@hidden> wrote:
>
> Core Data generated primitive accessors are used to get and set values from and to the managed object's private internal store. Core Data generated primitive accessors do not have change notification. If primitive accessors are present, Core Data will use them during undo and redo.
>
> A managed object may have resources that need to be updated when a property changes. During undo and redo primitive accessors are used to change the property but because primitive accessors do not have change notification there is no way for the managed object to be notified that the property has changed.
>
> The only solution seems to be to use custom primitive accessors that have change notification.
>
> What am I doing wrong?

You are mistaken. Core Data *does* fire KVO notifications during undo/redo. Its internal implementation does something along these lines:

[object willChangeValueForKey:key];
[object setPrimitiveValue:previousValue forKey:key];
[object didChangeValueForKey:key];


_______________________________________________

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: Jerry Krinock <email@hidden>
References: 
 >Detecting Managed Object Property Change From Undo Redo (From: Richard Charles <email@hidden>)

  • Prev by Date: Detecting Managed Object Property Change From Undo Redo
  • Next by Date: Trying to create a collection view with evenly distributed cell
  • Previous by thread: Detecting Managed Object Property Change From Undo Redo
  • Next by thread: Re: Detecting Managed Object Property Change From Undo Redo
  • Index(es):
    • Date
    • Thread