xcdatamodel 损坏
我被 xcdatamodel 损坏所困扰。我是新手,不知道该怎么做。也可以提供正在被质疑的文件以及 sqlite 数据库...
不知道该怎么做,因为我的大脑完全冻结了..请帮助。
TIA
I am stuck with xcdatamodel being corrupted. I am a newbie and have no clue what to do hereon. Can supply the file which is being questioned alongwith the sqlite db as well...
Do not know what do as I am quite literally brain frozen.. pls help.
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚遇到了同样的问题。就我而言,我将工作区中的文件移动到子文件夹中,并将组指向子文件夹。我相信这导致了腐败。
不幸的是我没有答案——尽管我尝试了很多方法。在损坏的文件之上恢复文件的备份不起作用。 xcdatamodel 文件必须具有某种类型的自引用。如果您将其作为包打开,然后将其内部内容作为包打开,您将看到 2 个文件:“elements”和“elements”。 “布局”。如果您将它们复制出来并将其重命名为具有 .plist 扩展名,您可以看到里面的内容。浏览这些 plist(看起来像对象存档)是一个相当艰难的过程,但您可能会看到一些明显的东西。
最后,我将整个项目目录恢复到新位置,打开项目,并能够将实体剪切并粘贴到全新的数据模型中。感谢上帝赐予时光机!
I just had the same issue. In my case, I was moving files in my workspace into sub folders and pointing the groups at the subfolders. I believe this caused the corruption.
Unfortunately I don't have an answer - although I tried a lot of things. Restoring a backup of the file over top the corrupted one didn't work. The xcdatamodel file must be have self-references of some kind. If you open it as a package and then open what's inside as a package, you'll see 2 files: "elements" & "layout". If you copy these out and rename them to have a .plist extension you can see what's inside. Its a pretty tough slog through those plists (looks like an object archive) but you may see something obvious.
In the end I restored my entire project directory to a new location, opened the project and was able to cut and paste the entities over to a brand new data model. Thank god for Time Machine!
我刚刚遇到了问题。
我有一台时间机器,所以我能够将它再次导入到 Xcode,但它不起作用。调查了xcode导入的“myapp.xcdatamodeld”包,只有“.xcccurrentversion”文件,没有“myapp.xcdatamodel”文件。我将丢失的文件复制粘贴到包中(右键单击/显示包内容)并且它起作用了。
I've just had the problem.
I had a time machine so I was able to import it again to xcode but it didn't work. Investigated the package "myapp.xcdatamodeld" imported by xcode, there was only the ".xcccurrentversion" file, but not the "myapp.xcdatamodel" file. I copy pasted the missing file in the package (right clic / show package content) and it worked.