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

你的呢?


当前回答

对我来说,它一直是:Command⌘+ 0:

在你调试或运行之后,如果你退出iPhone模拟器或调试应用,你会留下调试器窗口。

当你使用“单窗口布局”时,回到编辑器必须点击工具栏,这很烦人(加上你以后需要“删除细节窗格”)。

上面的快捷方式做到了这一点,并让您准备好编写代码。

其他回答

切换到头文件/源文件

选项命令⌘向上箭头↑ 查看>切换到头文件/源文件

在。m和。h文件之间切换。

在Xcode 4中,这是ctrl⌘向上箭头↑

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

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.

使用^T来交换前面两个字母

这适用于所有Cocoa应用程序,但我尤其喜欢在编码时使用它。使用^T (Control-T)来交换插入符号旁边的两个字母,或者当插入符号在末尾时,交换插入符号前面的两个字母。例如:

fi^T

... 就变成:

if

... 这是我经常犯的错别字。

“Ctrl+左/右箭头”进行字内文本导航。我使用这个特性将光标从变量中的一个“驼峰”跳转到下一个。

在选择文本时按住选项可选择文本的不连续部分。 按住选项,同时单击符号名称下拉菜单,按名称排序,而不是按它们在文件中出现的顺序。