
“The data model editor presents a unifIEd interface for Core Data’s
new fetch indexes feature as well as its existing property index and
entity compound index features. older data models are translated into
fetch index form for editing,and saved to the old file format when
necessary. Compiling a data model with a Deployment Target lower than
iOS 11,watchOS 4,macOS 10.13,or tvOS 11 continues to generate a
compatible compiled form. (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
知道如何修复构建错误吗?
更新:
除了从关系创建的情况外,Xcode 9正确地将复合索引转换为获取索引,如“已知问题”部分所述:
The data model editor only supports creating fetch indexes from attributes and Expressions in this beta,not from relationships. (32407895)
受影响的提取索引如下所示,可以从下拉菜单中选择唯一的属性:
但是,文档中没有描述的解决方法.
解决方法 我刚刚在Xcode 9 GM中遇到过这个问题.我观察到的是,在索引编辑器中取消选中Ascending复选框会导致出现此错误(它仅在我创建新索引后显示).我假设只在iOS 11提取索引中支持调整此索引属性(您会注意到您在Xcode 9之前创建的任何索引默认列为升序).TL; DR:确保在fetch index编辑器中检查所有属性的Ascending复选框.
总结以上是内存溢出为你收集整理的核心数据 – iOS:由于Xcode 9中的Fetched Indexes,无法编译CoreData模型全部内容,希望文章能够帮你解决核心数据 – iOS:由于Xcode 9中的Fetched Indexes,无法编译CoreData模型所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)