尝试查看 .xcdatamodel 时 XCode 崩溃

发布于 2024-10-11 23:19:43 字数 472 浏览 9 评论 0原文

我有一个由 Core Data 支持的应用程序,我已经研究了一段时间了。我使用版本控制(以前的 SVN,现在的 Git)在不同的 Mac 之间移动它。

前几天,我无法打开该项目。哦废话。幸运的是,由于时间机器,我能够回到过去,并恢复到早期版本。我怀疑 XCode 项目文件或核心数据文件的某些内容在这里起作用(我遇到了一些问题 这个人做到了,我猜),但一切似乎都很顺利,所以我继续前进。

但现在,我意识到当我尝试在 XCode 中打开 .xcdatamodel 文件时,我无法打开。它只是挂起,然后我就强制退出了。除此之外,该应用程序运行得很好。我可以将其部署到模拟器或设备上,并且它可以工作。但我不知道我怎么还有希望编辑。有什么建议可以解决这个问题吗?

I have an app, backed by Core Data, that I've been working on for awhile. I use version control (formerly SVN, now Git) to move it around between different Macs.

The other day, I was unable to open the project. OH CRAP. Luckily, due to Time Machine I was able to go back in time, and reverted to an earlier version. I suspected that something with either the XCode project files or the Core Data files was at play here (I ran into some of the problems that this guy did, I guess), but everything seemed to be working so I moved along.

But now, I realized that when I try to open the .xcdatamodel file in XCode, I can't. It just hangs and then I wind up Force quitting. Aside from that though, the app works totally fine. I can deploy it to the simulator or a device and it works. But I don't know how I have any hope of editing. Any tips on what I can do to fix this?

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

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

发布评论

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

评论(2

话少心凉 2024-10-18 23:19:43

我现在处于同样的情况,但是当我仔细查看模型文件原始文本时,我看到所有元素都具有关于屏幕矩形的奇怪属性,

<element name="myEntity" positionX="0" positionY="0" width="0" height="0"/>

因此我将其更改为

<element name="myEntity" positionX="10" positionY="10" width="128" height="240"/>

适用于所有实体。这成功了,现在我可以在 Xcode 中再次打开模型文件。

I was right now in the same situation, but when I've a close look to my model file raw text I saw all elements with strange attributes regarding screen rect

<element name="myEntity" positionX="0" positionY="0" width="0" height="0"/>

so I change this to

<element name="myEntity" positionX="10" positionY="10" width="128" height="240"/>

for all the entities. This did the trick, now I'm able to open to model file again in Xcode.

凉城已无爱 2024-10-18 23:19:43

最后,我删除了 XCode 中的模型文件并重写了它。幸运的是,时间并不长。如果其他人对如何修复损坏的模型文件有不同的建议,请留言,我可以将您的答案标记为已接受。

In the end, I wound up deleting the model file in XCode and rewriting it. Luckily it didn't take very long. If anybody else has a different suggestion on how to fix a corrupted model file please chime in and I can mark your answer as accepted.

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