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: Jerry Krinock <email@hidden>
- Date: Thu, 18 Nov 2010 06:17:43 -0800
On 2010 Nov 16, at 16:51, Quincey Morris wrote:
> 2. If you have a *custom* NSManagedObject subclass (i.e. whose subclass name is known to the Core Data entity), you can of course override the Core-Data-supplied accessor methods by writing your own. Adam was saying that there isn't supposed to be any legal way to use such custom subclasses during migration.
Thanks, Quincey. 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.
_______________________________________________
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