In Xcode 3, it was relatively easy to sort the source tree by name (see answer here for more details). However, I can't figure out how to sort the files and groups in Xcode 4 without manually dragging them around.
Asked
Active
Viewed 4,145 times
3 Answers
17
As of Xcode 4.3.1 - Select a Folder/Group in the project navigator area. Then go to Edit->Sort and you can choose "by name" or "by type."

macandyp
- 817
- 9
- 21
-
In my own experience with Xcode 4.6.2, this works but only for the first 100 files in a Folder/Group. – E.Freitas Jun 19 '13 at 15:13
-
1Unfortunately this isn't recursive. – Colin Basnett Sep 08 '16 at 16:41
3
There is no sort for the project navigator beyond drag and drop. Probably because it would be too easy to obliterate your careful organization.

Joshua Nozzi
- 60,946
- 14
- 140
- 135
-
18"it would be too easy to obliterate your careful organization." What? What other file browser on the planet doesn't sort? And if any deviant doesn't want the thing KEPT sorted, he could turn the option off. – Oscar Mar 30 '11 at 10:18
-
Accepting the answer, because it appears to be true that you simply cannot sort the project navigator in the current release. – curthipster Apr 28 '11 at 00:28
-
It isn't a file browser, it's a project navigator. The intention is logical organization of a developer project and not all projects' source can live in a single group. Some are quite complex. I hardly think non-alpha-sorted projects are really the deviants? – Joshua Nozzi Apr 28 '11 at 02:37
-
you could prefer a super-classing organization or whatever suits your needing. For your purposes simply ctrl+click on navigator over one or more folders -> sort by name – Enrico Cupellini Nov 12 '14 at 20:12
-
What about large projects with distinct modules? The Symbol Navigator Enrico mentions ignores the (very useful) logical tree structure that can be defined in the Project Navigator, which can drastically increase the required visual list scanning (a problem if you're working on a handful of classes in a small "area" of your project). A project is a collection of (among other things) file references, can contain internal "groups" (versus "folder references"), and is therefore logically divorced from its members' file system organization. Again: **Xcode's project browser is not a file browser.** – Joshua Nozzi Nov 12 '14 at 21:28
3
To accomplish something similar without touching your proj file, you may want to become best friends with CMD-SHIFT-O (Open Quickly ... was CMD-SHIFT-D in Xcode3). Start typing the filename and you'll see a list of matching files appear and you just pick from the list.

pho0
- 1,751
- 16
- 24
-
Thanks. Very well acquainted with that, and although "O" might make more sense than "D" for a command that opens file, I was briefly annoyed that they changed it in this version – curthipster Mar 29 '11 at 04:07