I deleted Main.Storyboard, recoverd it but - xcode

I deleted Main.Storyboard. I recovered it by dragging it back to the project in xcode. However, now it does not show in Base.Iproj (other than that everything is working).
I tried moving it back to Base.Iproj but when I do that, nothing shows in xcode.
What do I need to do to restore the project?

First move the Storyboard file to Base.Iproj, then drag it to project in Xcode. This will add the file to the project properly.

Related

Issue with Xcode in Main.Storyboard

I've been working on a project the last few weeks in Xcode and everything's been great. Main.Storyboard all of a sudden, will not load or open. Other projects open fine. There hasn't been any significant changes in this project. The last thing I tried doing was adding a navigation bar to one of my view controllers, to add buttons or items. I also tried adding a navigation item. Things started to complicate after trying to do these things. I have the latest version of Xcode, my project settings are linked correctly and tried rebooting my Mac but it doesn't solve anything. Does anybody know what may have caused this error and how to resolve?
The easy way:
Check out the latest working version of the storyboard file and try the changes again. Likely something odd and transient happened that corrupted the existing storyboard file (I've seen it happen with managed object model files before which are also XML underneath).
If there are too many changes to redo them:
Make a copy of the current storyboard file outside the repo and then checkout the latest working version of the file from the repo.
Diff the two files moving over changes that make sense from the troublesome file keeping an eye out for balanced tags (i.e. if a view has an opening tag but no closing tag Xcode will get confused).
Try opening the modified storyboard in Xcode. With luck it will open and be fine. Otherwise you will need to do a bit more digging or go back to option one and redo the changes.
I downloaded your repo and I can open Main.storyboard just fine:

How to add storyboard back to xcode after accidentally deleted

I accidentally deleted my storyboard from the Xcode project. I followed this thread : Accidentally deleted Main.Storyboard and fortunately I found it in Base.lproj folder.
But I'm having trouble to add it back to Xcode project. Since I'm new to iOS and Xcode still I couldn't add it back to my project. I can open it separately.
Can someone point me out how can I add it back to my project? Any help would be appreciated.
drag and drop it to Xcode's project navigator
uncheck "Copy items if needed"

Xcode 8 Storyboards Blank

For some reason in Xcode 8.1, all my storyboards are now blank, with boxes around where the content used to be:
I tried cleaning, deleting the Derived Data folder, and changing the size to Freeform but nothing has worked.
How do I fix this?
Try these:
Delete your derived data. Close xcode and clean, build again.
If option 1 not work then, Copy your project to another directory/folder. Close Xcode, open project from new directly and clean, build.

How do I recover a storyboard in 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.
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?
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 - 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>
Browse to that location.
2 - On your .app file, right click -> Show Package Contents.
3 - In resulting directory list, browse the folder Base.lproj. Under that you are likely to find your old storyboard.
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.
I also faced same problem in Xcode 7.
But when I copy and paste it from Derived Data. I got
"Interface Builder cannot open compiled nibs"
So If you delete storyboard by reference. First, check your project folder (using the Finder). If it's there, you can drag it back into your project in Xcode, or you can use the “Add Files to …” menu option. that file is work perfectly.

.xib files not showing up in MonoTouch

Right after building for the simulator I got an error message saying MonoTouch stopped unexpectedly and it shut down. So I closed Xcode and reloaded both. Now, I can't see my .xib files inside the MonoTouch file tree. I can open the .xib files directly in Xcode, but none of the resources need for the files are visible (for instance, images stored in the Resource folder).
How can I get these .xib files associated correctly again?
I fixed this. Had to go back and add each of my existing .xib files back into the project by right clicking on the appropriate folder and then finding the .xib file in the project folder. Once I added them all back, everything worked as expected

Resources