[resent to list-serve]

You can create a subclass of NSEntityMigrationPolicy, then specify this class 
in the Custom Policy for that entity in your mapping model. During migration, 
the createDestinationInstancesForSourceInstance:::: method of your migration 
policy class will be called, and can fill in the value for the new attribute.

Note that the object you will get to work with will be a generic 
NSManagedObject, and not any subclass you have defined for that entity. So if 
you need your subclass methods, or if you need to access other entities, and 
not just the one you are handed, you will need to do that AFTER migration has 
completed.

Dave

On 2012-10-31, at 5:44 AM, Rick Mann <rm...@latencyzero.com> wrote:

> Hi. I've added a simple attribute to my model that should be a concatenation 
> of a handful of other attributes, run through some code. I don't suppose 
> there's any way to do the lightweight migration but tell it, "here's a method 
> to call to get the default value of this property?"
> 
> I looked at doing a mapping model, but even that just has me build the value 
> in there; no apparent way to run it through my code.
> 
> Given that, I can let lightweight migration do its thing, then post-process 
> it, but I don't see a way to determine that lightweight migration ran when I 
> opened the store.
> 
> Any suggestions? Will -isConfiguration:compatibleWithStoreMetadata: tell me a 
> lightweight migration-capable change is incompatible?

It tells you whether or not a migration is needed (lightweight or otherwise).

> 
> Thanks,
> 
> -- 
> Rick
> 
> 
> 
> 
> _______________________________________________
> 
> 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