撷取的指标根据发行说明的CoreData模型时,Xcode 9增加了对获取的指标:的iOS:无法编译,因为在Xcode 9
“的数据模型编辑器提出了核心数据的统一接口 新提取索引功能以及现有属性索引和 实体复合索引功能。旧数据模型被翻译为 获取索引表单进行编辑,并在需要 时保存为旧文件格式。使用部署编译数据模型目标低于 iOS 11,watchOS 4,macOS 10.13或tvOS 11继续生成 兼容编译形式。 (30843153)”
我的项目有部署目标的时刻设置到iOS 9但我不能编译我的CoreData模型,它给了我为有一个复合索引集的每个实体以下错误:
?Model.xcdatamodeld/Model.xcdatamodel:MyEntity|compoundIndex[0]: error: Expression requires a concrete result type.
Model.xcdatamodeld/Model.xcdatamodel:MyEntity|compoundIndex[0]: error: Expression attributes are not compatible with the current deployment target.
Model.xcdatamodeld/Model.xcdatamodel:MyEntity|compoundIndex[1]: error: Expression requires a concrete result type.
Model.xcdatamodeld/Model.xcdatamodel:MyEntity|compoundIndex[1]: error: Expression attributes are not compatible with the current deployment target.
Model.xcdatamodeld/Model.xcdatamodel:MyEntity: error: Fetch Indexes feature requires iOS deployment target 11.0 or later
Model.xcdatamodeld/Model.xcdatamodel:MyEntity: error: Fetch Indexes feature requires Xcode 9.0 tools or later
任何想法如何解决生成错误
UPDATE:
的Xcode 9正确地转换复合索引到取对于除了那些从关系创建的所有案件的索引,因为“已知问题”一节中指出:
的数据模型编辑器仅支持创建取从属性和表现指标在这个测试版,而不是从关系。 (32407895)
受影响的获取指标看起来是这样,唯一的属性可以从下拉菜单中选择:
然而,在文档中的描述没有解决方法。
我在Xcode 9.0 Beta 3中收到此错误 – dmclean
我在Xcode beta 5或6中转换了我的项目,对于我的iOS 10目标而言,这很好,但我的SiriKit扩展只是iOS 11 - 不是。它告诉我一个索引是重复的,但我找不到任何重复。一旦找到解决方案,我会在这里发布答案。 – AlexK