随着大量的Xcode新手的涌入,我相信会有很多Xcode的技巧和技巧可以分享。
你的呢?
随着大量的Xcode新手的涌入,我相信会有很多Xcode的技巧和技巧可以分享。
你的呢?
当前回答
能够水平分割当前编辑器窗口,这对于宽屏监视器能够并排查看源文件和头文件非常有用。根据你使用的Xcode版本不同,有两种不同的方法。
在Xcode 3.0中,它位于首选项、键绑定、文本键绑定列表底部。
在Xcode 2.5中,它位于首选项、键绑定、菜单键绑定、视图菜单下。
其他回答
Xcode动作的键绑定
我也喜欢“重新缩进”。,则没有默认快捷方式,但您可以从“键绑定”首选项窗格的“文本键绑定”选项卡添加一个。
这本身就能节省时间。只需查找您最喜欢的操作和添加/编辑键盘快捷键!
我发现一个很方便的默认设置是CMD+"和CMD+'来添加/删除垂直分割。按住这些选项,现在你有相同的水平。但如果这些手势不适合你,你可以随时改变它们。
⌘命令+双击符号:跳转到符号的定义。
“选项”+双击符号:在符号的“文档”中查找文本。(只有当你安装了他们符号的Doc Set时才有效。)
收藏夹栏:
收藏夹栏就像你在Safari中存储收藏夹一样。我经常用它来存储我现在正在使用的文件的快捷方式(你可以通过拖拽来实现)。一般来说,当我处理一个大型或不熟悉的项目时,这更有用。
要显示收藏夹栏,请选择以下菜单选项:
查看>布局>显示收藏栏
你可以让Xcode在Info上运行预处理器。plist文件:
<key>CFBundleShortVersionString</key> #ifdef DEBUG <string>1.0 (debug)</string> #else <string>1.0</string> #endif
详情见http://developer.apple.com/technotes/tn2007/tn2175.html。
选择一个文本块并输入cmd-/将其注释掉。再次执行此操作以删除注释字符。
当通过双击平衡字符(括号、大括号、方括号)与大括号匹配结合使用时,这尤其有用。
使用类浏览器显示继承的方法
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.