随着大量的Xcode新手的涌入,我相信会有很多Xcode的技巧和技巧可以分享。

你的呢?


当前回答

从技术上讲,这是一个界面构建技巧,但它们是书籍匹配的一对,所以我不认为这是离题了……

Shift +右键单击其中一个控件,你会得到一个很好的对象层次结构选择列表。没有更多的点击,点击,点击,沮丧!

其他回答

双击方括号或圆括号,可获得括号与圆括号匹配。

Ctrl + 2:访问当前文件中的方法和符号的弹出列表。

这是非常有用的,因为有了这个快捷键,你可以完全使用键盘浏览文件。当你到达列表时,开始输入字符,列表就会选择你要找的符号。

通过命令行控制Xcode的文本编辑器:xed

> xed -x                # open a new untitled document
> xed -xc foo.txt       # create foo.txt and open it
> xed -l 2000 foo.txt   # open foo.txt and go to line 2000

# set Xcode to be your EDITOR for command line tools
# e.g. for subversion commit
> echo 'export EDITOR="xed -wcx"' >> ~/.profile

> man xed               # there's a man page, too

Cmd+Option+O to open a file in a separate window. Can configure Tab to always indent. I frequently use it to indent an entire file. Ctrl+Arrow keys to move between camel case words. If you have OneTwo, you can move from One to Two with Ctrl+Right arrow. You can use emacs bindings, there's even kill ring! I use the Ctrl+w and Cmd+C together when I need to copy two different pieces of text. In the documentation browser, you can restrict your searches to a particular library, e.g., just iOS 4.2 library. This helps me focus on API available only on a particular iOS/Mac version of the SDK. Cmd+Shift+A to build and analyze.

获取Colin Wheeler的完整Xcode键盘快捷键列表(PDF或PNG格式)。把它打印出来,放在显眼的地方(我把它贴在屏幕旁边的墙上)。

编辑: Xcode 3.2的更新版本

编辑2: Xcode 4的更新版本