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

你的呢?


当前回答

调试-如何使用GDB

作为新手,我发现捕捉和识别错误相当困难 艰巨的工作。控制台,尽管它是一个强大的工具,通常 不会产生非常直观的结果,不知道你是什么 在调试器中查看也同样困难 理解。在他们的帮助下 和关于Stack Overflow的好文章 可以在 可可与爱,它变得更友好一点。

其他回答

Xcode动作的键绑定

我也喜欢“重新缩进”。,则没有默认快捷方式,但您可以从“键绑定”首选项窗格的“文本键绑定”选项卡添加一个。

这本身就能节省时间。只需查找您最喜欢的操作和添加/编辑键盘快捷键!

我发现一个很方便的默认设置是CMD+"和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.

在拆分窗口时按住“选项”以垂直而不是水平拆分窗口。

普拉格玛市场

例子:

#pragma mark === Initialization ===

将这一行写在所有初始化方法之上,将在编辑器上方的下拉菜单中生成一个漂亮的标题。

开很快

Shift + cmd + D 开始输入你想打开的文件名。如果你在寻找框架头文件,这很酷。它们也有很好的注释,有时是文档的附加信息。

ESC

例如,当文本光标指向一个不完整的方法名时,按ESC键。它将搜索所有可能适合的内容,并且您可以快速完成非常大的方法名。如果您不能准确地记住一个方法的名称,这也很好。只需按ESC键。

我认为这些是我迄今为止知道的最好的。

(从被Stack Overflow用户删除的问题迁移过来,谢谢。)

在PyObjC中,你可以为符号下拉列表做类似的#pragma标记:

#马克:Foo

and

#马克:-