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

你的呢?


当前回答

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

其他回答

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

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在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。

一些技巧可以在Xcode Tools tips中找到。

使用#pragma进行组织

你可以使用:

#pragma mark Foo

... 作为组织源文件中的方法的一种方式。当通过弹出式菜单浏览符号时,无论你在Foo中放置什么,都会在列表中显示粗体。

要显示分隔符(即水平线),使用:

#pragma mark -

它非常有用,特别是在将委托方法或其他方法组分组时。

当在多个键盘上使用Code Sense时,使用control +来显示可用的补全列表,control +。插入最有可能的补全符,并control + / & shift + control + /在占位符令牌之间移动。所有的键都在键盘的主行下面,这对肌肉记忆有好处。