Xcode数据模型在编辑器中出现的问题 [英] Xcode data model problems with appearance in editor

查看:123
本文介绍了Xcode数据模型在编辑器中出现的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个应用程序,我在早期阶段,它有一个数据模型。到目前为止,它只有5个实体和一些关系。



到目前为止,我没有使用版本控制,只是从我的iPad删除应用程序,并重新加载它,当我做更改模式。到现在为止,我已经改变了架构几次。



今天早上,我试图添加一个新的实体与现有实体的关系在模型中。所有看起来都很好,直到我回去检查模型。图形视图都很棘手。缺少关系,箭头指向空白处,布局不是我保存的方式...



删除新实体会将事情恢复正常。或出现。



我可以添加没有问题的实体,但一旦我尝试和添加的关系,它被弄乱了。



我已经尝试创建一个新版本,将其设置为 当前,编辑它和每次相同的结果...我看不到任何解决它。



这是我第一次使用核心数据,所以也许它的东西dumb我的部分,但我很确定我做的完全相同的事情,我为其他4个实体。



帮助PLEASE!

解决方案

这里有一点点黑客来修复这个显示错误在Xcode,这通常是由于损坏的数据在 YourApp / YourApp。 xcdatamodeld / YourApp.xcdatamodel / layout



退出Xcode或关闭项目后,您只需删除此文件



或者,您可以在同一目录中编辑文件 contents 并且只需删除标记为< elements> ....< / elements> 。您的实体将在编辑器中彼此重叠,但它们应该在重新排列后立即工作。


Can anyone help 'cos this is driving me nuts!

I have an app I am at the early stages of and it has a Data Model. So far it has only 5 entities and a few relationships.

Up to now I have not been using versioning, just deleting the app from my iPad and reloading it when I make changes to the schema. This has worked fine up to now as I have changed the schema a couple of times.

SO this morning I tried to add a new entity with a relationship to an existing entity in the model. All seemed fine until I went back to inspect the model. The graph view is all screwy. Relationships are missing, the arrows point to empty space, and the layout is not how I saved it...

Deleting the new entity restores things to normal. Or appears to.

I can add the entity with no issues but as soon as I try and add the relationship it gets messed up. I think than the model itself is OK, just the graphic representation is mucked up.

I have tried creating a new version, setting that to current, editing it and the same result each time... I can't see anything to solve it.

This is my first time using core data so maybe it's something dumb on my part but I'm pretty sure I'm doing the exact same thing I did for the other 4 entities.

Help PLEASE!

解决方案

Here is a little hack to fix this display bug in Xcode, which is typically due to corrupted data in YourApp/YourApp.xcdatamodeld/YourApp.xcdatamodel/layout.

After quitting Xcode or closing the project, you can just delete this file (did not always work for me, sometimes the file is not there).

Alternatively, you can edit the file contents in the same directory and simply delete the whole section labeled <elements> .... </elements>. Your entities will all be on top of each other in the editor, but it should work now after rearranging them.

这篇关于Xcode数据模型在编辑器中出现的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆