[MacRuby-devel] problems implementing a NSEntityMigrationPolicy?

Michael Johnston lastobelus at mac.com
Wed Jan 27 22:35:16 PST 2010


Hi,

I'm having trouble implementing a NSEntityMigrationPolicy. Has anyone  
used subclasses of NSEntityMigrationPolicy in macruby successfully?

I've narrowed it down to the empty macruby implementation, which looks  
like this:

{{{

class V3RecipeIngredientToIngredient < NSEntityMigrationPolicy
   def createDestinationInstancesForSourceInstance(source,  
entityMapping:mapping, manager:manager, error:error)
     return true
   end

   def createRelationshipsForDestinationInstance(dInstance,  
entityMapping:mapping, manager:manager, error:error)
     true
   end
end

}}}

when I run this (and do a addPersistentStoreWithType with  
NSMigratePersistentStoresAutomaticallyOption) I get:

#<Class:0x10145fc80>: An error occured during persistent store  
migration.
userInfo: {"NSUnderlyingException"=>#<_NSCoreDataException:0x8002d8840>}

the _NSCoreDataException does not seem to have any message or other  
chain of errors.

the corresponding Objective C empty implementation works fine:

{{{
- (BOOL)createDestinationInstancesForSourceInstance: 
(NSManagedObject*)source
                                       entityMapping: 
(NSEntityMapping*)mapping
                                             manager: 
(NSMigrationManager*)manager
                                               error:(NSError**)error
{
   return YES;
}
}}}

Is there any way to get more detail on how/why it is failing?

Cheerio,

Michael Johnston
lastobelus at mac.com






More information about the MacRuby-devel mailing list