核心数据“文件”内容无法打开' [英] Core Data 'File "Contents" couldn't be opened'
问题描述
我犯了一个愚蠢的错误,不小心碰到了我当前的Core Data模型,而不是我刚刚创建的新版本。因此,我去了源代码管理并还原了 **。xcdatamodeld
组中的更改。但是我现在在该组的项目结构中有一个僵尸条目(它是我创建的新版本 **。xcdatamodel
),无法打开(消息如下)标题)。
I made the silly mistake and I accidentially touch my current Core Data model instead the new version one I just created. So I went to source control and reverted the changes inside the **.xcdatamodeld
group. However I have now a zombie entry in the project structure inside this group (its the new version **.xcdatamodel
I have created) that I can't open (message like in the title). Probably because reverting deleting the files but somehow the reference is still there.
只是有点烦人。尝试清洁,关闭和清洁重新打开。
Just a little bit annoying. Tried cleaning, closing & reopening.
推荐答案
我有两个同名文件,但在Xcode中只有一个显示。这样可以解决此问题:
I had two files with the same name, but only one showed in Xcode. This fixed it:
- 在项目中找到**。xcdatamodeld文件
- 右键单击并选择显示软件包内容
- 找到两个同名文件
- 删除大小为零字节的文件
- 重建并微笑
- Locate the **.xcdatamodeld file in your project
- Right click and select 'Show Package Contents'
- Locate the two files with the same name
- Delete the one that is Zero bytes in size
- Rebuild and smile
这篇关于核心数据“文件”内容无法打开'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!