How to restore a storyboard in xcode?

I have a little situation here. A few days ago, I accidentally deleted my storyboard, so I 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 in my project; the storyboard file is displayed in red, and when I click on it, nothing loads. To my horror, I thought that everything was lost, so I started building a new storyboard and connecting classes, outputs and actions.

Then I went to build a project on a simulator, and it was built using an OLD storyboard. I thought this could just load it from memory, so I uninstalled the application on the simulator and built the project again. The same thing again. So, I built it on my iPhone and, somehow, the old storyboard is still there, although I can not find it anywhere in my project.

What's going on here? Does this mean that I can restore my storyboard?

In addition, when I open the project inspector and go to the "Complex phases"> "Copy package resources" section, right-click on Storyboard.storyboard and click "Show in Search". He is showing my new storyboard. enter image description here

+6
source share
2 answers

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

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

Go to this location.

2 - In your .app file, right-click → Show Package Contents.

3 - In the list of resulting directories, find the Base.lproj folder. Underneath this, you'll probably find your old storyboard.

If you did Delete Derived Data with the Xcode organizer, you are unlikely to find anything here. But, fortunately, Xcode does not delete it twice according to your own wishes. So try your luck.

+5
source

I also ran into the same issue in Xcode 7.

But when I copy and paste it from Derived Data . I got

"Builder interface cannot open compiled tips"

So, if you delete the storyboard from the link. First check the project folder (using Finder). If it is there, you can drag it back to your project in Xcode, or you can use the option "Add files to ...". this file works fine.

0
source

Source: https://habr.com/ru/post/972121/


All Articles