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

你的呢?


当前回答

右键单击任何单词并选择“在API参考中查找所选文本”以搜索该单词的API。如果您需要查找类的可用属性和/或方法,这是非常有用的。而不是前往Apple.com或谷歌,你会得到一个弹出窗口,你正在寻找什么(或什么是找到的)。

其他回答

要默认在弹出式菜单中显示当前的自动完成选项(无需先按ESC),请键入

defaults write com.apple.Xcode XCCodeSenseAutoSuggestionStyle List

然后重新启动Xcode。

至于“快速打开”功能——它很棒,但我总是错过TextMate用于浏览项目和文件(符号,方法等)的cmd-shift-t。

这就是为什么我发布了一个Xcode插件来提供这个功能。它叫做Code Pilot,你可能想看看它:http://macoscope.net/en/mac/codepilot/

代码自动完成

Cmd + Ctrl + up / down折叠或展开所有函数。

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.