In NSEntityMigrationPolicy Class Reference, I read:

beginEntityMapping:manager:error:
Invoked by the migration manager at the start of a given entity mapping.

endEntityMapping:manager:error:
Invoked by the migration manager at the end of a given entity mapping.

Simple enough.  However, I find that in mysubclass, 
beginEntityMapping:manager:error: is sent to a certain instance, then 
createDestinationInstancesForSourceInstance:::: is sent to the same instance, 
once for each object in the store.  So far, so good.  But then 
endEntityMapping:manager:error: is sent to a *different instance*!  Makes it 
difficult to log a summary based on instance variables.

What could be the logic of this?

Jerry Krinock

Following is an abridged console log when I log the method name, 'self', the 
'mapping' parameter and the 'manager' parameter in each of the three methods.  
The middle method is invoked once for each of three objects in the store, so 
there are 5 lines.  Note that 'mapping' and 'manager' are always the same but 
'self' is different in the last line.

-beginEntityMapping::: self:0x176d3070 mapping:0x176d2ef0 manager:0x1eb02680
-createDestinationInstancesForSourceInstance:::: self:0x176d3070 
mapping:0x176d2ef0 manager:0x1eb02680
-createDestinationInstancesForSourceInstance:::: self:0x176d3070 
mapping:0x176d2ef0 manager:0x1eb02680
-createDestinationInstancesForSourceInstance:::: self:0x176d3070 
mapping:0x176d2ef0 manager:0x1eb02680
-endEntityMapping::: self:0x1eb67880 mapping:0x176d2ef0 manager:0x1eb02680

_______________________________________________

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

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

Reply via email to