I was about to add a new app icon in Xcode 4.3 when I accidentally clicked something in the project inspector (the joys of using the touchpad and not a mouse). I had my project selected and was about to add a new image for iPhone retina icon when I accidentally selected something and now I cannot see anything of my project. The last thing I remember seeing was a drop-down menu change to "Absolute" (I think as I only saw it for a moment) and I think the label was something to do with paths. The screen flashed and the entire project disappeared from the Xcode UI even though it is open.
The folder created in my Documents folder by Xcode is still in tact and all files are present. Even opening the project from here renders the same result - a completely empty Xcode except for appdelegte.h and .m.
I have even tried restoring an earlier snapshot but it does not help. When I open my project all I see is the AppDelegate.m and .h and nothing else. The only item in my project navigator where I used to see all my files is my app name .xcodeproj in red text. I cannot find anything to help me get my project back.
Can anyone help me to reverse this simple mistake?
I was able to reproduce this problem consistently and cause Xcode to crash in the process.
1] Start Xcode (Quit and re-start) and create a new utility project named TestProj. I don't believe the project type or name makes a difference but I didn't try any other combinations. Do not create a GIT.
2] After the project is created, simply click on "Location" which is greyed out because the project is selected in the project navigator. Once you have done this, the project is hosed and you can't get the project to open in project navigator again - it simply shows "TestProj.xcodeproj" where the project used to be listed in the project navigator.
3] To see Xcode crash, selected "Relative to SDK" and Xcode dies.
I have accidentally clicked on that greyed out location twice simply due to my apparently terrible mouse skills.
Apple, please fix this!
After reading:
Accidentally changed location of project file in file inspector, now can't see any project files in Navigator.
I went to Xcode (4.3 on Lion in my case), selected the project on the Project Navigator (left Xcode panel) and in the File Inspector (right Xcode panel) I updated its location to the Relative to Group value and then clicked over the little image button (underneath the location line) and selected my project.xcodeproj from Finder. It also solved the problem.
Best regards.
Ok - problem solved.
Eventually Xcode opened without crashing and with a seemingly useless file listed on the left in the navigator. I highlighted it (which is when Xcode was crashing all the time) and immediately clicked the in the project name text box in the inspector and entered my project name. Then selected the drop-down beneath it and selected relative to SDK. As soon as I let go (mouse-up) it changed to "Not Applicable" and my project re-appeared. Happy days! Only lost a day worth of work - but could have been worse...
Thanks to everyone who gave this some time...
Related
I'm new to xCode 4 and have playing with storyboards for most of the day. I was making an edit to one of the segue's and didn't realize that the entire file was selected, not just the arrow on the right side. This deleted my ENTIRE storyboard, which usually isn't a big deal as it's either still in the folder if i only deleted the reference, or in the trash if the file was actually deleted.
Strangely, it's in neither. I created a storyboard to test this out and sure enough, xCode warns "this can not be undone"....and it's gone. No where in finder or the trash bin.
Now, the weirdest part. My application is still running fine. I can't make any edits obviously as i can't bring it up, but xCode is still running fine. I've reset my computer and done everything else to clear it out but i can't my storyboard nor find it anywhere!
any help would be greatly appreciated...
jason
This happened to me as well - very alarming! However I searched for "storyboard" using SearchLight on the desktop. This found the file as the top hit! I was then able to track its location to a folder called en.lproj within the project folder and use File > Add to bring this folder back in.
Everything seemed fined except I had a problem every time I tried to delete the same image that caused the problem in the first place. The image was just sitting in a viewcontroller as a background image and each time I deleted it the whole storyboard vanished (temporarily).
So, I simply removed this viewcontroller altogether and created a new one and that worked. Much better than recreating the whole storyboard!
Running Analyze in Xcode 4.0.2 shows issues in the Issue Navigator. Clicking on an issue makes the appropriate file appear in the Editor pane, but nowhere does it show where in the code the issue occurs as I am used to from Xcode 3.x. Does anyone know how I can turn on this feature?
A couple of tips:
First, if you're looking for the view where Xcode annotates the project with arrows, bear in mind that you may need to expand the top-level analyser result in Xcode's Issue navigator and click the second-level issue in order to see those - see screenshots.
Screenshot 1: top-level issue selected - no arrows
Screenshot 2: second-level issue selected - arrows!
Second tip: if that stuff isn't working, try cleaning the project's build products folder. Hold down the Option (alt) key and choose Clean Build Folder... from the Product menu. (You need to hold down the Option key, otherwise you won't see that menu option.)
I've seen this happen before sometimes. I believe it's a bug in Xcode. Restart Xcode and try again.
One note. I'm seeing this for files that are referenced outside the current project. I currently have a library in which the files with missing annotations live and simply added them to my current project without copying them. Haven't done the project dependency setup yet, so if you're referring to files outside your project that could be why. (I opened the library project, did an analyze and the annotations showed up.)
Woohoo, I've nailed it! At least for me. I've been struggling with this problem for about 2 hours now, trying out all the things suggested here and more (Xcode 4.0.2, Snow Leopard). Bizarre thing was I had one file where the warning were correctly showing in the editor. Then I noticed the difference to all other files; in the File Inspector pane the location was specified as "Relative to Project" (warnings show correctly in the editor), all the other project files were "Relative to Group" (warnings not showing in the editor).
I took one of the problem files, switched it's location to "Relative to Project", reanalyzed and bingo! I've see it's warnings in the editor.
I guess this ties in a bit with David Goodine's answer refering to files outside the project.
I am working on Struts project using the Spring Source Toolsuite IDE.
When there are complier errors or something, a red X mark or yellow exclamation mark appear over the icon for my project.
But even after I made sure there are no complier errors, I got this exclamation mark in my project icon. My project is building and running successfully and I am getting the proper output.
Why is it there? How can I find out what it is complaining about?
Click Window -> Show View -> Problems and you'll see the list of errors/warnings and you can take it from there.
As ptsw pointed out, too:
If the Problems item isn't visible in Window -> Show View menu, choose Other... instead and select Problems in the General group to view the Problems pane:
I just upgraded to Xcode 4, and I'm trying to open a project I created with the previous Xcode, but when I open it, after about 1 second, it hides all the folders and inline projects in the project navigator, and only shows the "resources" folder. Strange behavior. I can compile and run, but I can't edit my files from xcode any more.
Anyone else see this?
#haider I had the same issue with XCode 4.3, tried the above recipe, but it did not work for me. Here is the correct answer to prevent this from happening and get it to work right:
There's a tiny row of icons to the left of the search box under the left hand nav. The first of these is a '+' (to add a file). The icons following the add-a-file icon are actually filters that can be toggled on and off. The first of these looks like a clock, and is a filter to show only-recently-modified files, the second to show files-with-source-control status and so on. I must have accidentally picked the first icon after the '+' (show only recently-modified files) and therefore had the problem. The XCode UI preserves that pick even when you close the project so closing and re-opening does not alleviate the situation.
Don't know why it fixed, but it did. After closing down xcode and restarting several times, it ended up working ok again. Strange
There are some pretty horrible instructions out there for renaming projects in Xcode. Is there no easy way to do this?
In Xcode 4 try this:
⌘+1, click the blue node with the project name, wait a second, click again (the name becomes editable). That's it.
In the menu bar choose Project -> Rename...
It'll do all the hard work for you and rename everything that needs renaming apart from the folder that the project is in.
In XCode 4, select the project name at the top of the documents list on the left and hit enter, rename it, and then XCode will show you a list of files that will be altered, as well as allowing you to take a snapshot.