Xcode 问题:快速跳转到特定的选择器/类/符号?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1114540/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode question: Quickly jump to a particular selector/class/symbol?
提问by PlagueHammer
What is the quickest way to jump to a particular symbol/selector/class in Xcode? (I'm looking for keyboard shortcuts preferably).
在 Xcode 中跳转到特定符号/选择器/类的最快方法是什么?(我最好在寻找键盘快捷键)。
Right now, I know two ways of doing this:
现在,我知道两种方法:
- “Open Quickly” > Click on the Symbols dropdown menu at the top of the editor > Select the selector to jump to it.
- Click on “Project Symbols” in the “Groups and Files” section on the left sidebar, and type in a name in the Search text field in the top right of the XCode window.
- “快速打开” > 单击编辑器顶部的符号下拉菜单 > 选择选择器以跳转到它。
- 单击左侧边栏“组和文件”部分中的“项目符号”,然后在 XCode 窗口右上角的“搜索”文本字段中输入名称。
Is there a quicker way of doing this? (If I could even assign a shortcut to jump to the “Project Symbols”, that would suffice for me. Alternatively, if I can find a keyboard shortcut to jump to the symbol dropdown above an editor that would do it to).
有没有更快的方法来做到这一点?(如果我什至可以分配一个快捷方式来跳转到“项目符号”,那对我来说就足够了。或者,如果我能找到一个键盘快捷方式来跳转到一个编辑器上方的符号下拉菜单,那将是这样做的)。
For experienced Xcode programmers, what do you use to jump to a symbol?
对于有经验的 Xcode 程序员,你用什么来跳转到一个符号?
回答by e.James
In Xcode 3.2, the "Open Quickly" command (Shift-Control-D) lets you type in selectors and class names as well as file names. This would at least get you close to what you wanted.
在 Xcode 3.2 中,“快速打开”命令 (Shift-Control-D) 允许您输入选择器和类名以及文件名。这至少会让你接近你想要的。
Your idea about using the "Symbols" drop-down also works. You can use the keystroke Control-2 to bring up the Symbols drop-down menu, and then use the arrow keys, or start typing the name of the method that you want to reach.
您关于使用“符号”下拉菜单的想法也有效。您可以使用按键 Control-2 调出符号下拉菜单,然后使用箭头键,或开始键入您想要访问的方法的名称。
Edit: In Xcode 4, the "Symbols" drop-down appears when pressing Control-6. You can change this in the Xcode settings by changing the key binding for "Standart Editor > Show Document Items".
编辑:在 Xcode 4 中,按下 Control-6 时会出现“符号”下拉列表。您可以通过更改“标准编辑器 > 显示文档项目”的键绑定在 Xcode 设置中更改此设置。
回答by Peter Hosey
If you're looking at the symbol in a source file and want to jump to its definition, ?-click it.
如果您正在查看源文件中的符号并想跳转到其定义,请单击它。
回答by cocoatoucher
(command + double click) on your symbol/selector/class in any place of your implementation to jump to them (option + double click) on framework classes/selectors to jump to their reference in help->documentation
(命令 + 双击)在您实现的任何位置的符号/选择器/类上跳转到它们(选项 + 双击)框架类/选择器上以跳转到它们在帮助-> 文档中的参考
回答by PlagueHammer
One (arguably crude) way to do it seems to be as follows:
一种(可以说是粗略的)方法似乎如下:
This is based on the fact that the Search field at the top right of the Xcode window seems to change behavior depending on what is selected in the Groups & Files sidebar.
这是基于这样一个事实,即 Xcode 窗口右上角的搜索字段似乎会根据在组和文件侧栏中选择的内容改变行为。
- Select “Project Symbols” in the “Groups & Files” sidebar
- Press ??F (That is Command+Option+F) to jump to the Search field
- Enter the symbol to jump to, and an outline will quickly show up
- 在“组和文件”侧栏中选择“项目符号”
- 按??F(即Command+Option+F)跳转到搜索字段
- 输入要跳转的符号,快速出现轮廓
(this will remain in effect until you click on something else in the Groups & Files sidebar)
(这将一直有效,直到您单击“组和文件”侧栏中的其他内容)