是否可以恢复删除的xcdatamodel文件? [英] Is it possible to recover my deleted xcdatamodel file?

查看:66
本文介绍了是否可以恢复删除的xcdatamodel文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我愚蠢地删除了它。我删除了其中包含不同版本的文件。

I foolishly deleted it. I deleted the file that contained different versions within it.

我可以恢复为旧快照,但是从那时起我已经完成了工作。

I can revert to an old snapshot but I've done work since then.

是否可以还原到我的一个存档,还是只能从那里提交/共享?

Is it possible to revert to one of my archives or can I only submit/share from there?

我仍然可以运行该应用程序,但是我需要对数据库进行更改。

I can still run the application, but I need to make changes to the database.

推荐答案

Xcode将.xcdatamodels编译为.moms。在管理器窗口中,您可以使用分发...来导出为Xcode存档。为此,找到存档文件,右键单击并选择显示包内容。在其中导航到产品/应用程序以找到您的应用程序。显示其中的软件包内容,并且如果使用版本控制模型,则应在其中直接包含.mom文件,或者在.momd文件夹中包含一堆文件。

Xcode compiles .xcdatamodels into .moms. From the Organiser window you can use 'Distribute...' to 'Export as Xcode Archive'. Do that, locate the archive file, right click and select 'Show Package Contents'. In there navigate to Products/Applications to find your application. Show the package contents of that and in there should be either your .mom file directly or a bunch of them in a .momd folder if you're using a versioned model. Grab the .moms you want.

然后激活Xcode模式编辑器,然后从菜单栏中选择Editor-> Import ...。您应该可以从那里导入.mom,重新创建您的Core Data模式。

Then activate the Xcode schema editor and from the menu bar select Editor->Import... . You should be able to import a .mom from there, recreating your Core Data schema.

这篇关于是否可以恢复删除的xcdatamodel文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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