Storyboard Suddenly GONE from Xcode - ios

While I was working on this Xcode project, compile and run an app, the two files suddenly gone!!!
It was working fine and I run the app a few times already. Anybody has any clue why is it happening?
My Mac is warning for Disk Space recently. Would it be something related?
Please help...I have been working on the project for a few weeks already. Anyway I could recover what I lost? I archive it a few hours ago into an IPA, can I recover the lost files from there?
Thanks a lot.
EDIT-------------------------------------
The Files are gone and I have to work for 12 hours to get my app back to running as it was before.
I think the problem was that my Mac was out of Disk Space, and when I tried to run, the AutoSave from Xcode failed to save. And for some reason the failure caused Xcode the delete the file when saving failed.
Learning from the lesson. I will do what folks here suggested from now on:
1) Time Machine
2) Git
3) Periodic zip the project and put on Dropbox and an external hard disk
4) Always ensure there's enough disk space
Thanks all. Hope nobody else would have to go through what I went through.

1) Are you using "Time Machine"? If not, consider this a wake-up call.
2) Use Spotlight (the magnifying glass in the upper right corner of your Macintosh menu) to find those missing files.
3) Once you do find them, delete the old files and re-add them to your project, making sure the "Target Membership" checkboxes are set.

Disk space warning is a good indication that things of this sort could happen. Some say you need to have %50 of the disk free. Whether it's true or not, filling the disk to the point system warning is a serious sign that you should free up enough space.
Sometimes a restart can magically 'find' a file, but I'm sure you tried that already. I'd try to find it in the project folder, or on the disk itself and not through XCode.
Most chances are the files are there, but XCode cannot see them for some reason.

Have you looked in the projects directory?
Also are you using source control (Locally or git) ?

I had the same problem, some of my views on the storyboard disappeared after Xcode crashed. After looking for a while for an answer I noticed the view still shows on the hierarchy panel. checking its properties I noticed that Xcode had changed my width and height properties to 0. Once I restored them, the view shows again. Long story short, check the properties, if the width and height are 0 the view becomes invisible.

Related

Xcode crashed while renaming project - whole project broken

I wanted to release an app I worked on and quickly change the project name. I usually duplicate projects before doing things like this but this time - because this procedure always worked on Xcode as I found it way more reliable than e.g. Eclipse - I didn't, which I immediately regretted.
Opened Xcode again and now I am seeing this
I guess all the linking is gone now which is why Xcode doesn't "find" the files anymore. Renaming the remaining project stem to the old name gives
couldn’t be moved to because an item with the
same name already exists
and also manual renaming of folders won't work as the .xcodeproj is gone.
The project is written in Objective-C, and all the classes are still persistent, but the effort of adding all the xib's, referencing the outlets, setting architectures, etc will become the nightmare of my life. I do have a half-way recent backup but everything I did to make the app store-ready today will be gone.
Any ideas on how to rescue my project?
EDIT: What Xcode is now showing on the welcome screen is a project called "project" (literally) and it has the usual compass icon but with a white instead of a blue background referring to the path <project folder>/<new project name>/ and below that "white" project there is a folder icon with the new name pointing to <project folder>.
I also made a snapshot before, of course it now says "Unable to read snapshots" in the "restore from snapshots" window.
Ok what I now did is renaming ALL references from the old project name to the new one. I even changed file names. I used Xcode's CMD+SHIFT+F and TextWrangler's "replace" function and thankfully I still had the .xcodeproj from yesterday's backup so from there I could copy it into the new project and rename stuff. There are still some things that don't work perfectly, for example auto layout doesn't "stretch" contents over the screen (it stays on iPhone 4s size, even on 6 plus simulator), I needed to set the scheme again and Launch Images / Icons got lost but I can look over that. The only thing I am afraid of now is that the final build might miss out a symbol or something like that so I eventually have a corrupt file in the App Store, but man it's a beta version, how much worse can it get anyway?
Thanks to everyone recommending me to even backup the broken project, I did this even before you said it but because I think it's a valuable advice I wanted to put it in my answer as well.
It's a shame that stuff like this can happen, I've been backing up my work on a daily basis and my project never got corrupted - until now.

Xcode stalls on "loading" when trying to create new project

Xcode 6 never gets past "Loading" when I try to create a new project. I actually was able to create a new project yesterday, but I decided to just ditch it completely (deleted). Clearly there must be a bad file somewhere, possibly related to the project I deleted, since I also see the same stalling behavior now with Xcode 5.1, which has worked fine for creating new projects in the past. Xcode 6 has worked fine when starting with an already existing project and still appears to do so. I did not see this exact problem in your data base, though one person saw the project creation freeze before reaching the stage I get to. Their solution was to delete Xcode and every possible file related to it, which I'm a little squeamish about, since I don't want to affect existing projects, and don't have an understanding of what the various files are for.
Deleting the DerivedData of Xcode should fix the issue. You can do this by heading to ~/Library/Developer/XCode/DerivedData (with a Finder window open press cmd+G) and deleting all the subfolders of it.
This is embarrassing, but if it could happen to me, maybe it could happen to someone else. The problem was that the window that came up after the second step in defining the type of project to be created, the one in which you choose where to save the project's files, extended off the bottom of the screen, so that only the very tops of the buttons were visible. Eventually, I realized the one to the far right might be the one to click to continue. Which it was. Feel free to delete this question.

Accidentally deleted my target, can't get program to work

I hit 'backspace' while having selected one of my launch images and then absentmindedly pressed 'okay' before reading the popup dialog. This deleted my target, which apparently cannot be reversed.
So I created a new target with the same name as the old one and had it point to my project file. But when I run my program, it just shows a blank white screen. I checked MainStoryboard.storyboard to find that it had deleted all of my storyboards. Is there any way for me to recover my old MainStoryboard? Or my old Target? I've been trying for the last 30 minutes, looking stuff up online, nothing has worked.
I have an archive of the project from RIGHT before this happened. Is it possible to restore my project from that archive? I haven't created a snapshot since a couple of weeks ago (this was probably stupid of me) so reverting to a snapshot isn't an option.
Any help you can offer me would be greatly appreciated. This is my first iOS app. Not an hour ago I find out that my initial version was rejected from the app store for being too simple. This version had 5 completely new features, I really don't want to have lost it; this entire situation is just so disheartening.

iOS still able to reference files after I remove them

I feel dumb for asking this, but I've spent like two hours trying to figure it out. I have a bunch of pictures that I included in my xcode project. I have them named background1.png, background2.png, background3.png etc.. I was renaming & messing around with the numbers of the photos and whatnot, and for some reason when I ran my code and I called [UIImage imagenamed #"background7.png"] I was getting background9.png instead. So I figured I have duplicate images in my project somewhere.
I deleted all the background images that I can find in my project. And when I run the code, even though I think they should all be gone, these images are still showing up. I opened up the finder and deleted any reference of background*.png I can find on my entire computer, and I tried moving the project to a different directory and it is still finding these photos. I thought that maybe the simulator/phone is caching the images so I deleted the app, didn't help. Any ideas on where these images might be hiding to where I can't find them anywhere but they can still be referenced?
You need to follow two simple steps :-
Clean your project. (Xcode->Product->Clean)
Delete application from device/simulator
Run again.
Hope this helps you..
You need to clean and build the project again. Press command + shift + K and then run(command + R) the code again. You can also try resetting the simulator or remove the app from there. If you are using device, you can remove the app from there.

Add large database file to iOS App bundle at compile time to avoid indexing?

I'm having a severe problem using the new versions of Xcode (4.4 & 4.5) in that, my project has a very large .sql database file stored in the project. This file cannot change, for many reasons... but it is +270Mb in size. This causes Xcode to hang on 'Indexing File...' and becomes completely slow and unresponsive to the point that I have to force quit the app, and cannot actually get any coding done. I have raised a bug report with Apple several times, but it is seemingly being ignored!
I do not want to disable Xcode indexing entirely as i find the code completion features incredibly useful.
My question is: Can i remove the database from the Xcode bundle resources, and then add it automatically at compile time?
Would appreciate any and all advice on how I could get round this problem.
Regards,
Sam
Incase anyone comes across this problem of Xcode indexing a huge unwanted file... I fixed it by setting the file type in Xcode to an 'MP3 Audio file'...
Doesn't seem to have any effect on the function of the .sql file once it's in the App, but stops Xcode trying to index it.
If anyone has a better solution for this, i'd love to hear it!

Resources