• 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: Core Data: During Migration, should use Primitive Accessors only?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: During Migration, should use Primitive Accessors only?


  • Subject: Re: Core Data: During Migration, should use Primitive Accessors only?
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 18 Nov 2010 12:00:31 -0800

On Nov 18, 2010, at 06:17, Jerry Krinock wrote:

> My claims are that such usage should not happen, and indeed you don't want it to happen, but if you're not careful, it will happen…
>
> 1.  If you invoke -(set)foo of -(setValue:)forKey: during a migration, and you have overridden accessors with custom accessors, Core Data will find the custom accessors and use them.
>
> 2.  This will cause undesirable results.
>
> 3.  To prevent Core Data from using the custom accessors during migration, use the "…Primitive…" accessors instead.

Well, I apologize if I'm going round in a circle here, but if you have an object that executes the overrides instead of the Core-Data-provided accessors, you must have an object of the custom subclass of NSManagedObject.

How did such an object come to exist? Adam's point was that during migration the object is actually of class NSManagedObject, not the subclass. It shouldn't be possible to legally create an instance of the subclass.


_______________________________________________

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: 
 >Core Data: During Migration, should use Primitive Accessors only? (From: Jerry Krinock <email@hidden>)
 >Re: Core Data: During Migration, should use Primitive Accessors only? (From: Adam Swift <email@hidden>)
 >Re: Core Data: During Migration, should use Primitive Accessors only? (From: Jerry Krinock <email@hidden>)
 >Re: Core Data: During Migration, should use Primitive Accessors only? (From: Adam Swift <email@hidden>)
 >Re: Core Data: During Migration, should use Primitive Accessors only? (From: Jerry Krinock <email@hidden>)
 >Re: Core Data: During Migration, should use Primitive Accessors only? (From: Quincey Morris <email@hidden>)
 >Re: Core Data: During Migration, should use Primitive Accessors only? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Core Data: During Migration, should use Primitive Accessors only?
  • Next by Date: Re: On self = [super init...] ...
  • Previous by thread: Re: Core Data: During Migration, should use Primitive Accessors only?
  • Next by thread: forcing accessibility focus
  • Index(es):
    • Date
    • Thread