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.
Related
I've been using Aptana Studio 3 for awhile now and I like it much better than Dreamweaver. However, one quirk that's starting to annoying is that if I have a few scripts/documents open from my project, when I click on one of the open tabs the project explorer automatically jumps and selects that file in the list.
This is very annoying when trying to view a list of files in a directory and also trying to type in a script/document that is located in another directory.
So my question is: How do I get Aptana Studio 3 to not automatically jump to a file like that?
Thanks.
I don't know why this post was voted down. I think people don't like to actually read the FAQ.
I believe your problem is the 'Link with Editor' option in the Project Explorer. You can find it under the little arrow at the top right of the Project Explorer. Make sure it is turned off.
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...
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!
This one is stupid, and there's probably a ridiculously simple answer I'm just not aware of:
I'm trying to edit the plist for my Settings.bundle to implement preferences in my app. I want to tweak the order of a few groups, but I can't figure out how to move rows around. In XCode 3 you could just drag rows around to rearrange them, but it seems this no longer works in XCode 4. Short of deleting everything and re-recreating them in the correct order, how can I re-arrange the rows?
Thanks.
You can move an entry by grabbing the right side and moving it up, you just can't move it down.
I think it's an annoying gotcha that quite a few have run in to.
Check out:
How do you change a plist's root object type to NSArray in Xcode 4
and:
Change the editor Xcode 4 uses for property lists?
Basically, you can't. Changing the plist editor to textedit was the best solution for me. Also you can right click on the plist file and select "Open As > Source Code" to edit the plist raw.
It looks like the same problem is back in XCode 5. By grabbing it on the right you can drag it around, but you can't drop it anywhere. The only way I found was to open the list as source code like #Ralphleon said, which is simple enough to do if you have basic XML skills.
Update: With the new XCode that comes with Lion and iOS 5, moving rows works again.
Yes the order matters if you care about the order the preferences appear in your app settings.
I just create a new item (+) in the settings list where I would like an existing item placed. Then copy (right mouse click) that existing item and paste it on top of the new item. And then delete any duplicates.
In XCode 5.1, you can drag rows and drop them to a parent item. You can't rearrange siblings directly, but by dropping them on the parent item, the child jumps to the top among the siblings.
Check out the app PlistEdit Pro. It handles everything properly. Not free. But if you're doing lots of plist work it's essential.
Here
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