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

你的呢?


当前回答

CTRL + Alt +⌘+ r清除日志

其他回答

如果高亮显示搞砸了,如果你的变量没有高亮显示或其他任何东西,只需执行⌘-A⌘-X⌘-V,这将全部选中,剪切和粘贴,所有高亮显示将被纠正。所以只要按住⌘,然后按A X V。

链接一个新的框架

(在Groups and Files窗格中,打开Targets披露三角形以显示与项目相关的目标。)

在Groups and Files窗格中,双击当前项目目标以显示target Info面板。 在Info面板中,选择General选项卡。下方窗格显示当前链接的框架。 通过按面板左下角的+按钮,并从出现的工作表中显示的列表中选择,添加一个新框架。(重要的是,表格中的列表只显示了与目标相关的框架…)

(这在两年前是不可用的,但是值得指出的是,比起在文件系统中找到框架并将其拖放到项目中,它可以节省大量的时间……)

Ctrl + 2:访问当前文件中的方法和符号的弹出列表。

这是非常有用的,因为有了这个快捷键,你可以完全使用键盘浏览文件。当你到达列表时,开始输入字符,列表就会选择你要找的符号。

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

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.

当您在一个方法上使用代码完成,并且它有多个参数时,使用CTRL + /移动到下一个需要填充的参数。