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

你的呢?


当前回答

我不太喜欢xcode中内置的代码格式化/reindent功能,所以我发现使用uncrustify作为代码格式化器非常有用。它可以作为用户脚本使用:http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/

其他回答

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

例如:

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

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

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

使用类浏览器显示继承的方法

Apple's API reference documentation does not show methods inherited from a superclass. Sometimes, though. it's useful to be able to see the full range of functionality available for a class -- including a custom class of your own. You can use the Class Browser (from the Project menu) to display a flat or hierarchical list of all the classes related to a current project. The upper pane on the right hand side of the browser window shows a list of methods associated with the object selected in the browser. You can use the Configure Options sheet to select "Show Inherited Members" to show inherited methods as well as those defined by the selected class itself. You click the small book symbol to go to the corresponding documentation.

选择一个文本块并使用

Command + '/' 

注释掉该文本块。选择注释块,并使用相同的快捷方式取消注释。

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

完整的快捷方式列表可以在这里找到:http://iphonehuston.blogspot.com/2009/08/shortcuts-for-xcode.html