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

你的呢?


当前回答

Cmd+Option+O to open a file in a separate window. Can configure Tab to always indent. I frequently use it to indent an entire file. Ctrl+Arrow keys to move between camel case words. If you have OneTwo, you can move from One to Two with Ctrl+Right arrow. You can use emacs bindings, there's even kill ring! I use the Ctrl+w and Cmd+C together when I need to copy two different pieces of text. In the documentation browser, you can restrict your searches to a particular library, e.g., just iOS 4.2 library. This helps me focus on API available only on a particular iOS/Mac version of the SDK. Cmd+Shift+A to build and analyze.

其他回答

使用xcodebuild命令行在共享构建机器上进行干净的构建:

cd project_directory
xcodebuild -configuration Release -alltargets clean
xcodebuild -configuration Release -alltargets

Xcode支持文本宏,可以通过编辑菜单末尾的插入文本宏菜单调用。它们也可以使用Code Sense (Xcode的代码补全技术)来调用。

例如,键入键序列pi m control-period将插入#import "file"到你的代码中,file作为一个可编辑的标记,就像代码完成一样。

调试-如何使用GDB

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

打印完整的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.