Xcode 4 按名称对文件进行排序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5253941/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 4 Sort Files By Name
提问by ghempton
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 3.x 中,我可以执行 Edit > Sort > By Name。我在新版本的 Xcode 中找不到这个功能。我该如何实现?
采纳答案by MarkPowell
This is a missing feature (a major one, IMO) from Xcode 4.
这是 Xcode 4 缺少的功能(主要功能,IMO)。
EDIT: As of 4.2 it's back in!!!
编辑:从 4.2 开始,它又回来了!!!
回答by chakrit
It ISthere in Xcode 4.2 (not sure about earlier versions though.)
它IS有在Xcode 4.2(不知道早期版本虽然)。
y http://f.cl.ly/items/1m0r0y190y0D2w2t3t1D/Screen%20Shot%202555-01-04%20at%2012.16.31%20.png
y http://f.cl.ly/items/1m0r0y190y0D2w2t3t1D/Screen%20Shot%202555-01-04%20at%2012.16.31%20.png
回答by memmons
From my previous answer:
从我之前的回答:
This was, sadly, left out of Xcode4 -- I loved that feature. You can fix it though. Here's how:
遗憾的是,这被 Xcode4 遗漏了——我喜欢这个功能。你可以修复它。就是这样:
First, jump over to Apple's Bug Reporterand file a feature request. Seriously, go ahead. I'll wait until you are back.
首先,跳转到Apple 的 Bug Reporter并提交功能请求。说真的,继续。我等你回来。
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.
现在是可怜的人的替代品,直到 Apple 修复它:重新组织您的项目,使您的大部分文件位于子目录中(真实的,而不是 Xcode 逻辑“组”文件夹)。通常,我将文件排列在类、控制器、资源、图像、基础和支持文件中。这涵盖了我所有文件的大约 95%。每当您需要对 Xcode 中的文件重新排序时,只需删除一个文件夹引用并将其添加回来——该文件夹中的文件将再次按字母顺序排列。
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.
诚然,不像在 Xcode3 中那么好,但是一旦你组织了你的项目文件夹结构,只需花一点时间就可以毫不费力地重新按字母顺序排列。
回答by Eddie Gasparian
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.
提示:在路径菜单中选择级别时按住 Command 键以按字母顺序查看其项目。
http://developer.apple.com/library/mac/#recipes/xcode_help-jump_bar/Recipe.html
http://developer.apple.com/library/mac/#recipes/xcode_help-jump_bar/Recipe.html
回答by jdtogni
- 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.
- 退出你的项目
- 备份您的 project.pbxproj 以防万一
- 找到您最烦人的目录的“儿童”会话
- 以某种方式对其进行排序(我使用了 linux sort -k3)
- 打开您的项目。
Worked for me :P
对我来说有效:P