Xcode 4 Sort Files By Name
XcodeXcode4Xcode Problem Overview
In Xcode 3.x I could do Edit > Sort > By Name. I cannot find this functionality in the new version of Xcode. How do I accomplish this?
Xcode Solutions
Solution 1 - Xcode
This is a missing feature (a major one, IMO) from Xcode 4.
EDIT: As of 4.2 it's back in!!!
Solution 2 - Xcode
It IS there in Xcode 4.2 (not sure about earlier versions though.)
Solution 3 - Xcode
From my previous answer :
This was, sadly, left out of Xcode4 -- I loved that feature. You can fix it though. Here's how:
First, jump over to Apple's Bug Reporter and file a feature request. Seriously, go ahead. I'll wait until you are back.
Back? Great! We are one step closer to getting that feature. Nice job!
Now for the poor man's substitute until Apple fixes it: Re-organize your project so most of your files sit in sub-directories (real ones, not Xcode logical "group" folders). Typically I have my files arranged in Classes, Controllers, Resources, Images, Foundation, and Supporting files. This covers about 95% of all my files. Whenever you need to reorder the files in Xcode, simply remove a folder reference and add it back -- the files in that folder will once again be in alphabetical order.
Admittedly, not as nice as in Xcode3, but once you have your project folder structure organized, it just takes a moment to re-alphabetize things without too much effort.
Solution 4 - Xcode
It's a missing feature, if you want to sort permanently. However, there is a feature to view items sorted temporarily, namely in the jump bar:
> Tip: Hold down the Command key when selecting a level in the path menu to view its items alphabetically.
http://developer.apple.com/library/mac/#recipes/xcode_help-jump_bar/Recipe.html
Solution 5 - Xcode
- Quit your project
- Backup your project.pbxproj just in case
- find the "children" session of your most annoying directory
- sort it somehow (I used linux sort -k3)
- Open your project.
Worked for me :P