更改 .xcdatamodeld 文件中 .xcdatamodel 条目的顺序

发布于 2024-12-18 09:55:42 字数 257 浏览 7 评论 0原文

我有几个核心数据模型版本已添加到我的 .xcdatamodeld 文件中,并且我添加的最后一个版本没有像通常那样显示在列表顶部,它是 .xcdatamodeld 文件下列表中的第二项。 xcdatamodeld 文件。我将最新版本设置为当前版本化的核心数据模型,但我无法通过拖动 .xcdatamodel 条目来重新排序它们,所以有什么方法可以更改条目的顺序,以便最新版本显示在顶部?

顺便说一句,我使用的是 Snow Leopard 的 Xcode 4.2 build 4C199。

I have several Core Data model version that I have added to my .xcdatamodeld file, and this last version that I added did not show up at the top of the list as it normally does, it is the 2nd item in the list under the .xcdatamodeld file. I set the latest version as the current versioned Core Data model, but I cannot reorder the .xcdatamodel entries by dragging them around, so is there any way that I can change the order of the entries so that the newest version shows up at the top?

By the way, I am on Xcode 4.2 build 4C199 for Snow Leopard.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那片花海 2024-12-25 09:55:42

是的,这部分非常烦人 - 但它并不太难。我一直这样做。您必须使用文本编辑器自行编辑 MyProject.xcodeproj/project.pbxproj 文件(我使用 vim),并查找模型列表的位置,然后只需重新排序子项部分,如下所示:

    D6A5760112F22213004DEDCE /* Scott.xcdatamodeld */ = {
        isa = XCVersionGroup;
        children = (
            D6B7528A1506A0050066268A /* Scott-V14.xcdatamodel */,
            D659922515057BC100955005 /* Scott-V13.xcdatamodel */,
            D6EDB44614ED9D7E00C02938 /* Scott-V12.xcdatamodel */,
            D6931E6214D78135007F0E03 /* Scott-V11.xcdatamodel */,
        );
        currentVersion = D6B7528A1506A0050066268A /* Scott-V14.xcdatamodel */;
        name = Scott.xcdatamodeld;
        path = Shared/Scott.xcdatamodeld;
        sourceTree = "<group>";
        versionGroupType = wrapper.xcdatamodel;
    };

Yeah, this part is totally annoying - but it's not too hard. I do it all the time. You have to edit the MyProject.xcodeproj/project.pbxproj file yourself with a text editor (I use vim for this), and look for where your list of models are, then just re-order the children section, like this:

    D6A5760112F22213004DEDCE /* Scott.xcdatamodeld */ = {
        isa = XCVersionGroup;
        children = (
            D6B7528A1506A0050066268A /* Scott-V14.xcdatamodel */,
            D659922515057BC100955005 /* Scott-V13.xcdatamodel */,
            D6EDB44614ED9D7E00C02938 /* Scott-V12.xcdatamodel */,
            D6931E6214D78135007F0E03 /* Scott-V11.xcdatamodel */,
        );
        currentVersion = D6B7528A1506A0050066268A /* Scott-V14.xcdatamodel */;
        name = Scott.xcdatamodeld;
        path = Shared/Scott.xcdatamodeld;
        sourceTree = "<group>";
        versionGroupType = wrapper.xcdatamodel;
    };
小女人ら 2024-12-25 09:55:42

在 Xcode 版本 12.4(可能是更早的版本)中,此信息已发生变化。

为核心数据实体添加属性时,+ 会在列表顶部插入新属性以供编辑。但是,返回实体将按字母顺序显示属性。

With Xcode Version 12.4--and probably a much earlier version--this information has changed.

When adding attributes for a Core Data entity, the + inserts a new attribute at the top of the list for editing. However, coming back to the entity will show the attributes in alphabetical order.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文