During migration you have a bare NSManagedObject and not your custom subclass. 
So any custom code has to be in a migration policy.

Sent from my iPhone

> On May 20, 2014, at 12:07 PM, Mike Abdullah <mabdul...@karelia.com> wrote:
> 
> 
>> On 20 May 2014, at 15:21, Sean McBride <s...@rogue-research.com> wrote:
>> 
>> Hi all,
>> 
>> Doing a Core Data migration (not the lightweight kind) I hit an error at the 
>> end:
>> 
>> "foo is a required value."
>> 
>> the 'foo' relationship it complains about is transient and so not present in 
>> the store.  Normally, I recreate the relationship in awakeFromFetch, but it 
>> doesn't seem to call that during migration.  As a test I made the 
>> relationship optional, then it no longer complains.
>> 
>> This seems to mean that transient relationships must always be optional?!  
>> At least if you ever want to migrate.  That seems odd.  Am I missing 
>> something here?
> 
> How about -awakeFromInsert? During a migration, new objects are being 
> created, based on the existing ones. Thus -awakeFromInsert gets called on 
> them rather than -awakeFromFetch.
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.ca

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to