Re: Core Data: During Migration, should use Primitive Accessors only?
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