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

你的呢?


当前回答

构建成功/失败噪音;从术语:

defaults write com.apple.Xcode PBXBuildSuccessSound ~/Library/Sounds/metal\ stamp.wav
defaults write com.apple.Xcode PBXBuildFailureSound ~/Library/Sounds/Elephant

其他回答

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

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.

链接一个新的框架

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

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

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

迅速打开……

命令⌘Shift⇧D 文件>快速打开…

我是Open quick功能的忠实粉丝,它在Xcode 3.1及后续版本中表现得特别好。当你想打开项目或框架中的文件或符号定义时,只需点击键盘快捷键,键入文件或符号名称的位,使用向上箭头↑和向下箭头↓选择正确的结果(如果需要),然后点击返回系键打开文件或导航到符号定义。

在Xcode 4上:

命令⌘Shift⇧o


“快速打开”使用当前单词作为搜索词

此外,直到两分钟前(当schwa在评论中指出它时)我才知道Xcode的一些事情是,如果编辑器的文本插入符号在一个单词中,当Open quick被调用时,这个单词将被用作Open quick搜索词。

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

右键单击函数中的变量,然后单击edit all in scope。自从我发现了这个,我就一直在用它。

ctrl⌘T