ghempton
ghempton

Reputation: 7947

Xcode 4 Sort Files By Name

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?

Upvotes: 67

Views: 8353

Answers (5)

MarkPowell
MarkPowell

Reputation: 16540

This is a missing feature (a major one, IMO) from Xcode 4.

EDIT: As of 4.2 it's back in!!!

Upvotes: 56

chakrit
chakrit

Reputation: 61518

It IS there in Xcode 4.2 (not sure about earlier versions though.)

y http://f.cl.ly/items/1m0r0y190y0D2w2t3t1D/Screen%20Shot%202555-01-04%20at%2012.16.31%20.png

Upvotes: 27

memmons
memmons

Reputation: 40492

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.

Upvotes: 7

Eddie G.
Eddie G.

Reputation: 2344

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

Upvotes: 5

jdtogni
jdtogni

Reputation: 129

  1. Quit your project
  2. Backup your project.pbxproj just in case
  3. find the "children" session of your most annoying directory
  4. sort it somehow (I used linux sort -k3)
  5. Open your project.

Worked for me :P

Upvotes: 1

Related Questions