简体   繁体   English

ios / xcode:是否可以从模拟器中恢复丢失的主要故事板?

[英]ios/xcode: Posssible to recover lost main storyboard from build in simulator?

Some time ago, I accidentally deleted the main storyboard of my app. 前一段时间,我不小心删除了应用程序的主故事板。 I read to find it in the trash folder and just drag it back to you project which I did. 我阅读以在垃圾箱文件夹中找到它,然后将其拖回到我所做的项目中。

However, I did not realize that doing this does not actually transfer the file back where it belongs. 但是,我没有意识到执行此操作实际上不会将文件传输回它所属的位置。 It just gets the app to reference the storyboard in the trash folder. 它只是让应用程序引用垃圾文件夹中的情节提要。

Having largely forgot about this, in a misplaced fit of organization, I emptied my trash today and now the main storyboard shows in red in the app and is missing. 在很大程度上忘记了这一点之后,由于组织错位,我今天清空了我的垃圾,现在主故事板在应用程序中显示为红色,并且丢失了。

One person answering a similar question said to look in the base.lproj directly of derived data. 回答类似问题的一个说,直接在base.lproj中查找派生数据。 I did this and found a launch screen but no main storyboard. 我这样做了,找到了启动屏幕,但没有主故事板。

I do however have the app still running in the simulator. 但是,我的应用程序仍在模拟器中运行。

Wondering if there is anyway to recover the storyboard from there. 想知道是否有从那里恢复故事板的方法。

I also btw tried the data recovery route with drill disk but it did not turn up the file. 我也尝试过使用钻盘进行数据恢复,但是它没有打开文件。

Do you have any suggestions? 你有什么建议吗?

I did not realize that doing this does not actually transfer the file back where it belongs 我没有意识到执行此操作实际上不会将文件传输回它所属的位置

Well, it does if you ask it to. 好吧,如果您要求的话也可以。 When you drag something into the project, you are shown a dialog with a checkbox asking whether you want to copy that thing into the project folder. 当您将某些内容拖到项目中时,将显示一个带有复选框的对话框,询问您是否要将其复制到项目文件夹中。 If you didn't check that checkbox, that was your own fault. 如果您没有选中该复选框,那是您自己的错。

You can't retrieve the storyboard from the simulator or (same thing) from the built app, because they are not the same storyboard. 您无法从模拟器或构建的应用程序中检索情节提要,因为它们不是同一情节提要。 The built app contains a compiled version of the storyboard (a .storyboardc file). 内置的应用程序包含情节提要编译版本( .storyboardc文件)。 Thus, you cannot restore from this the source of the storyboard, any more than you could extract the source code of a code file from the compiled binary of a built app. 因此,你不能从故事板的本,比你可以从内置的应用程序的编译的二进制提取代码文件的源代码做任何更多的恢复。

You're likely to have better luck retrieving the storyboard from a backup. 从备份中检索情节提要可能会更好。 For example, perhaps your Mac has Time Machine running; 例如,您的Mac可能正在运行Time Machine。 if so, you've got the original storyboard in a recent Time Machine backup. 如果是这样,则您在最近的Time Machine备份中拥有原始的故事板。 And of course any decent programmer who cares about his work will be keeping that work under version control (eg git), so the storyboard will be present in a commit saved before you moved it to the trash. 当然,任何关心他的工作的体面的程序员都将把该工作保持在版本控制下(例如git),因此,在将故事板移到回收站之前保存的提交中将有故事板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM