本文介绍了'< ...>不是有效的NSFetchRequest."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用自定义的源表达式
I am using a custom source expression
NSExpression(format: "FETCH(FUNCTION($manager, \"customFetchRequestForSourceEntityNamed:predicateString:\" , \"\(mapping.sourceEntityName!)\", \"TRUEPREDICATE\"), $manager.sourceContext, NO)")
用于映射模型.
提取通常在自定义方法中执行,但是异常'< ...>不是有效的NSFetchRequest.'
稍后会在 NSMigrationManager.migrateStore()
方法内抛出.
The fetch is being executed normally within the custom method, but exception '<...> is not a valid NSFetchRequest.'
is thrown somewhere later inside the NSMigrationManager.migrateStore()
method.
有任何线索吗?
推荐答案
此方法的预期结果类型为 NSFetchRequest
,而不是获取的返回内容.
The expected result type of this method is NSFetchRequest
, not what the fetch returns.
签名应该是-
extension NSMigrationManager {
@objc func customFetchRequest(forSourceEntityNamed entityName: String, predicateString: String) -> NSFetchRequest<NSFetchRequestResult> {
这篇关于'< ...>不是有效的NSFetchRequest."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!