随着大量的Xcode新手的涌入,我相信会有很多Xcode的技巧和技巧可以分享。
你的呢?
随着大量的Xcode新手的涌入,我相信会有很多Xcode的技巧和技巧可以分享。
你的呢?
当前回答
突出显示代码块(重点跟随选择)
从View -> Code Folding -> Focus Follows Selection或controlloptionf激活“Focus Follow Selection”。
这也适用于Python代码,但是在一行中引入空格会使它失效。为了解决这个问题,安装谷歌的Xcode插件,并在它安装的首选项中激活“正确的保存空白”。这将在每次保存文件时清除尾随的空白,因此如果高亮显示出错,您只需保存文件,它就会再次工作。(看,这实际上是两个提示在一起,因为插件的这个特性本身很有用)。
下面是我刚刚写的一些随机Python代码的示例。我使用午夜Xcode语法着色主题。
这对于代码的高嵌套部分非常有帮助,可以跟踪内容在哪里。另外,注意左边,就在行号的右边,这些部分也是有颜色的。这是代码折叠条。如果你把鼠标滑下,它会高亮鼠标下方的部分。这些彩色条都可以折叠,换句话说,代码中高亮显示的部分正是可以折叠的部分。
其他回答
完整的快捷方式列表可以在这里找到:http://iphonehuston.blogspot.com/2009/08/shortcuts-for-xcode.html
使用类浏览器显示继承的方法
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 Tools tips中找到。
⌘命令+双击符号:跳转到符号的定义。
“选项”+双击符号:在符号的“文档”中查找文本。(只有当你安装了他们符号的Doc Set时才有效。)
收藏夹栏:
收藏夹栏就像你在Safari中存储收藏夹一样。我经常用它来存储我现在正在使用的文件的快捷方式(你可以通过拖拽来实现)。一般来说,当我处理一个大型或不熟悉的项目时,这更有用。
要显示收藏夹栏,请选择以下菜单选项:
查看>布局>显示收藏栏
当在多个键盘上使用Code Sense时,使用control +来显示可用的补全列表,control +。插入最有可能的补全符,并control + / & shift + control + /在占位符令牌之间移动。所有的键都在键盘的主行下面,这对肌肉记忆有好处。