什么是核心数据模型中的获取索引元素?

问题描述 投票:8回答:1

在我的xcdatamodel中,两个新字段byTitleIndexcompoundIndex显示在Fetch Index Elements下。我以前在Xcode中没见过这个部分。什么是获取索引元素?

Screenshot of Xcode xcdatamodel highlighting compoundIndex field

ios xcode core-data entity xcdatamodel
1个回答
14
投票

获取索引元素是2017年WWDC上宣布的Apple新索引API的一部分。它们允许您指定一个或多个索引元素;用于为更快的数据库搜索创建索引的属性。在您的情况下,“title”属性将用于在“Passage”实体下创建一个名为“compoundIndex”的索引,从而允许更快的标题搜索。

公告:https://developer.apple.com/videos/play/wwdc2017/210/?time=628

但是:ぁzxswい

文档(向下滚动到“使用索引”):https://developer.apple.com/videos/play/wwdc2017/210/?time=997

© www.soinside.com 2019 - 2024. All rights reserved.