• 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: Forcing Core Data to save attribute changed behind its back?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing Core Data to save attribute changed behind its back?


  • Subject: Re: Forcing Core Data to save attribute changed behind its back?
  • From: Sean McBride <email@hidden>
  • Date: Thu, 26 Jul 2012 14:04:40 -0400
  • Organization: Rogue Research Inc.

On Tue, 24 Jul 2012 13:32:21 -0700, Sixten Otto said:

>On Tue, Jul 24, 2012 at 11:27 AM, Sean McBride <email@hidden>
>wrote:
>> Yes.  My object is a subclass of NSObject and I don't override
>isEqual:.  As I test, I overrode it and always return NO.  At first, I
>thought this did the trick, since Core Data passed through this and
>saved properly; but alas, it only seems to go through the path once
>after the document is opened, not every time I ask it to save.
>
>Are you still also triggering the KVO notices and/or using the setter?

Yes.

>My thinking was that you probably need both things: first, to take an
>action that causes Core Data to notice you're changing the value (like
>calling -will/didChangeValueForKeyPath:), and second, that when Core
>Data compares the before and after values, that they are not -isEqual:
>to one another.
>
>(But, to be clear, this is untested supposition on my part.)

I thought it was a very clever idea, alas it only half worked.  Like Kyle says, somewhere someone is doing pointer-equal checks.

Thanks!

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

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


References: 
 >Forcing Core Data to save attribute changed behind its back? (From: Sean McBride <email@hidden>)
 >Re: Forcing Core Data to save attribute changed behind its back? (From: Sixten Otto <email@hidden>)
 >Re: Forcing Core Data to save attribute changed behind its back? (From: Sean McBride <email@hidden>)
 >Re: Forcing Core Data to save attribute changed behind its back? (From: Sixten Otto <email@hidden>)

  • Prev by Date: Re: Using NSTerminateLater with a Status Item
  • Next by Date: iOS Rendering PDFs on a Background Thread
  • Previous by thread: Re: Forcing Core Data to save attribute changed behind its back?
  • Next by thread: Re: Forcing Core Data to save attribute changed behind its back?
  • Index(es):
    • Date
    • Thread