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

你的呢?


当前回答

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

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.

其他回答

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

打印完整的Xcode键盘快捷键列表,并把它放在你的显示器旁边。

选择一个文本块并输入cmd-/将其注释掉。再次执行此操作以删除注释字符。

当通过双击平衡字符(括号、大括号、方括号)与大括号匹配结合使用时,这尤其有用。

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

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

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

编辑: Xcode 3.2的更新版本

编辑2: Xcode 4的更新版本