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

你的呢?


当前回答

在打开的文件之间来回导航: ⌥⌘← ⌥⌘→

其他回答

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.

Cmd + ~(波浪号-看起来很奇怪的按钮…)

在任何打开的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.

如果高亮显示搞砸了,如果你的变量没有高亮显示或其他任何东西,只需执行⌘-A⌘-X⌘-V,这将全部选中,剪切和粘贴,所有高亮显示将被纠正。所以只要按住⌘,然后按A X V。