Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sort File List in Xcode4?

This was answered for XCode 3, but not XCode4. Answer for XCode3 has not gotten an answer for 4.

So:

Is there a way in Xcode4 to sort my list of files under say the Classes folder Alphabetically? It appears this option has disappeared.

I am happy to remove this question and move to the XCode3 answer after it has been answered, if that makes folks happier.

like image 347
The Mad Gamer Avatar asked Oct 24 '22 11:10

The Mad Gamer


1 Answers

Update: Good news, everyone! As of Xcode version 4.5, you can now sort by name or type. Select the files you want to sort and choose Edit > Sort > By Name. Thanks to @Snow-Crash for mentioning this in the comments below. Please upvote the comment!

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.

like image 117
memmons Avatar answered Oct 31 '22 11:10

memmons