Search code examples
iosswiftcore-datacore-data-migration

Where is default source fetch `fetchRequestForSourceEntityNamed:predicateString:` for `NSMigrationManager` defined?


The default source fetch expression sourceExpression FETCH(FUNCTION($manager, "fetchRequestForSourceEntityNamed:predicateString:" , "MyEntity", "TRUEPREDICATE"), $manager.sourceContext, NO) refers to fetchRequestForSourceEntityNamed:predicateString: method of NSMigrationManager.

But it is not defined anywhere, or at least I could not find it!

I want to override this method to return an array of unique items, preferably by calling the super method first and filtering later.

Can you point me to the default definition of this method?


Solution

  • It is an Apple private API. There is no documentation available. Give it an entity, predicate string, and test it thoroughly. Of course, you can also pass it your own function instead of overriding.