如何在 xcode 中恢复故事板? [英] How do I recover a storyboard in xcode?

查看:42
本文介绍了如何在 xcode 中恢复故事板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这里有一点情况.几天前,我不小心删除了我的故事板,所以立即进入我的垃圾箱,将故事板拖回项目中.一切正常.但后来我清空了我的垃圾箱,故事板似乎不再出现在我的项目中;故事板文件显示为红色,当我点击它时,没有加载任何内容.令我沮丧的是,我认为一切都失去了,所以我开始构建一个新的故事板并连接类、出口和行动.

I have a little bit of a situation here. A few days ago, I accidentally deleted my storyboard, so immediately went into my trash and dragged the storyboard back into the project. Everything worked fine. But then I just emptied my trash and the storyboard no longer appears to be in my project; the storyboard file is showing up red and when I click on it, nothing loads. To my dismay, I thought all was lost so I started building a new storyboard and connecting the classes, outlets and actions.

然后我去在模拟器上构建项目,它是用 OLD 故事板构建的.我认为它可能只是从内存中加载它,所以我删除了模拟器上的应用程序并重新构建了项目.又是同样的事情.然后我将它构建到我的 iPhone 上,不知何故旧的故事板仍然存在,即使我在我的项目中的任何地方都找不到它.

I then went to build the project on the simulator, and it's building with the OLD storyboard. I thought it might just be loading it from memory so I deleted the app on the simulator and built the project again. Same thing again. So then I built it to my iPhone and somehow the old storyboard is still there even though I can't find it anywhere in my project.

这是怎么回事?这是否意味着我可以恢复我的故事板?

What's going on here? Does this mean I'll be able to recover my storyboard?

此外,当我打开项目检查器并转到 Build Phases > Copy Bundle Resources,然后右键单击 Storyboard.storyboard,然后单击在 finder 中显示时,它会显示我的新故事板.

Also, when I open the project inspector and go to Build Phases > Copy Bundle Resources, and right click on Storyboard.storyboard, and click show in finder, It shows my new storyboard.

推荐答案

1 - Derived Data 中有一个地方,路径如下:

1 - There is a place in Derived Data with following path:

/Users/<Your user name>/Library/Developer/Xcode/DerivedData/<Your App Name>/Build/Products/Debug-iphonesimulator/<app Name.app>

浏览到该位置.

2 - 在您的 .app 文件上,右键单击 -> 显示包内容.

2 - On your .app file, right click -> Show Package Contents.

3 - 在结果目录列表中,浏览文件夹 Base.lproj.在此之下,您可能会找到旧的故事板.

3 - In resulting directory list, browse the folder Base.lproj. Under that you are likely to find your old storyboard.

如果您已经从 XCode 管理器中完成了Delete Derived Data,您将不可能在此处找到任何内容.但幸运的是,XCode 不会违背您的意愿两次删除它.所以试试你的运气.

If you have done Delete Derived Data from XCode organizer, you are not likely to find anything up here. But fortunately, XCode doesn't delete it twice against your own wishes. So try your luck.

这篇关于如何在 xcode 中恢复故事板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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