开发者

Xcode 4 Sort Files By Name

开发者 https://www.devze.com 2023-02-16 01:57 出处:网络
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 accomp开发者_JAVA技巧lish this?This is a missing feature (a major one, IMO) from X

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 accomp开发者_JAVA技巧lish this?


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

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


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


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.


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


  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

0

精彩评论

暂无评论...
验证码 换一张
取 消