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

你的呢?


当前回答

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.

其他回答

没有多少键盘快捷键,但是源代码中的TODO注释显示在编辑器顶部的方法/函数下拉列表中。

例如:

// TODO: Some task that needs to be done.

在方法和函数的下拉列表中显示,以便您可以直接跳转到它。

大多数Java ide在滚动条中为这些任务标记显示一个标记,这样更好,但这也可以工作。

如果你有一个多点触控功能的Mac -使用MultiClutch来映射一些由鼠标手势描述的击键。

我用三个手指向前和向后在文件历史中向前和向后移动(cmd-alt-.),并在.h和.m之间切换。

右键单击函数中的变量,然后单击edit all in scope。自从我发现了这个,我就一直在用它。

ctrl⌘T

⌘'来正确格式化(重新缩进)您的代码

编辑:显然重缩进功能(编辑>格式>重缩进)没有默认的快捷方式。我想我很久以前就分配了一个(在Preferences > Key bindings中),甚至不记得了。抱歉误导你了。

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