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

你的呢?


当前回答

CTRL + Alt +⌘+ r清除日志

其他回答

无需重新编译的调试日志记录

cdespinosa的回答堆栈溢出问题我如何调试与NSLog(@“内部的iPhone模拟器”)?给出了一种不需要重新编译源代码的调试通过日志技术的方法。这是一个神奇的技巧,可以让代码摆脱调试的麻烦,有一个快速的周转,如果我早一点知道它,就可以为我省去无数的麻烦。

TODO comments

在注释前面加上TODO:将导致它显示在函数“快捷”下拉菜单中,例如:

int* p(0); // TODO: initialize me!

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.

Command⌘alt shift T:在项目树中显示当前编辑的文件。

当键入一个方法时,按ESC键查看代码完成选项(毫无疑问,这已经在前面提到过)。我已经知道这一点,但今天我发现,如果你按下代码完成窗口右下角的按钮(它要么是'A',要么是Pi),你可以在字母排序和按类层次排序之间切换。

突然之间,这个窗口就有用了!

Cmd + Ctrl + up / down折叠或展开所有函数。