Hi Jerry, thanks for the reply. I managed to get the subclass methods to fire 
eventually, I have no idea what I was doing wrong though. I trashed all my 
files and started again and for some reason that fixed it.

But I now have another problem, core data migrates fine without the 
NSEntityMigrationPolicy subclass, however as as soon as I add it it's name in 
the "custom Policy" field  I get the following error, which is perplexing me...


Unresolved error Error Domain=NSCocoaErrorDomain Code=134110 UserInfo=0x1ea4b0 
"Operation could not be completed. (Cocoa error 134110.)", {
    NSUnderlyingError = Error Domain=NSCocoaErrorDomain Code=256 
UserInfo=0x1ec540 "Operation could not be completed. (Cocoa error 256.)";
    reason = "Failed to save new store after first pass of migration.";



My first thought was that maybe I had to call 'super' in 'endEntityMapping', 
but I tried it and it made no difference...

- (BOOL)endEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager 
*)manager error:(NSError **)error
{
        NSLog(@"endEntityMapping");
        [super endEntityMapping: mapping manager: manager error: error];
        return YES;
}




On 8 Sep 2010, at 01:57, Jerry Krinock wrote:

> 
> On 2010 Sep 06, at 05:31, Ben wrote:
> 
>> my NSEntityMigrationPolicy subclass methods are not being called so that I 
>> can run further migration code.
>> 
>> @implementation TestMigrationPolicy
>> 
>> - (BOOL)beginEntityMapping:(NSEntityMapping *)mapping
>>                   manager:(NSMigrationManager *)manager      
>>                     error:(NSError * *)error
> 
> Just made a custom migration yesterday, doing what you said you did, and it 
> worked fine.  However the only method I've ever implemented in my 
> NSEntityMigrationPolicy subclasses is 
> createDestinationInstancesForSourceInstance:entityMapping:manager:error:.  
> I've never had any trouble with it.  That method should be called once for 
> each object in your store.
> 
> Or maybe stick an NSLog() in +initialize.
> 

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to