核心数据“文件”内容无法打开' [英] Core Data 'File "Contents" couldn't be opened'

查看:65
本文介绍了核心数据“文件”内容无法打开'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我犯了一个愚蠢的错误,不小心碰到了我当前的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:


  1. 在项目中找到**。xcdatamodeld文件

  2. 右键单击并选择显示软件包内容

  3. 找到两个同名文件

  4. 删除大小为零字节的文件

  5. 重建并微笑

  1. Locate the **.xcdatamodeld file in your project
  2. Right click and select 'Show Package Contents'
  3. Locate the two files with the same name
  4. Delete the one that is Zero bytes in size
  5. Rebuild and smile

这篇关于核心数据“文件”内容无法打开'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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