Re: CoreData Migration Problems
Re: CoreData Migration Problems
- Subject: Re: CoreData Migration Problems
- From: Jerry Krinock <email@hidden>
- Date: Thu, 10 Feb 2011 19:00:40 -0800
On 2011 Feb 10, at 18:37, Gordon Apple wrote:
> The error handles gives 10 console messages, "The operation couldn’t be
> completed", which is the exact number of records in the test database. So
> something is definitely going awry in the mapping.
Log these errors' -userInfo. In particular, look for an NSUnderlyingErrorKey.
> OK. I've identified the problem. The one new entity relationship in
> mainEntity is not optional. Changing it to optional allows lightweight
> migration to work.
I **never** use non-optional properties, because of all the corner cases I've seen while the object is being built up or torn down, and Core Data finds a non-optional property to be missing and has a seizure.
> However, that has its own issues. I had it non-optional
> for a reason. It is essential in the new database.
Well, then, write your own code to do the validation. Another reason not to use non-optional properties (Core Data's built-in validation) is because when Core Data finds such a property missing, it *displays* an error dialog with an inexplicable message to your user. No. Write your own validation code and handle your own validation errors.
_______________________________________________
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