有没有办法跳转到 Xcode 中的特定方法? [英] Is there a way to jump to a specific method in Xcode?
问题描述
我使用 Xcode 4.3 进行 Objective-C 开发.我在其他文本编辑器(我知道 Xcode 是一个 IDE)中喜欢的一个功能是跳转到同一代码文件中的方法定义.
I'm using Xcode 4.3 for Objective-C development. One feature that I like in other text editors (I know Xcode is an IDE), is jumping to a method definition within the same code file.
例如,如果我在 Calculator 的 @implementation 中,并且计算器有 10 个方法,我会喜欢一种在它们之间跳转的方法.
For example if I'm in @implementation of Calculator and calculator has 10 methods, I will like a way to jump between them.
如果我按 command+L 我可以跳转到特定的行号,有没有办法以类似的方式跳转到方法定义?例如而不是键入行号,只键入方法名称的开头.
If I press command+L I can jump to a specific line number, is there a way to jump in a similar way but to a method definition? e.g. instead of typing the line number to type only the beginning of the method name.
我能否以某种方式打开一个对话框,输入方法签名的开头并立即查看搜索结果,如果我选择一种方法,它会让我找到它?
Can I open somehow a dialog box, type the beginning of a method signature and see instantly the search results and If I pick one method it will get me to it?
有没有办法从一个方法跳转到下一个方法?
Is there a way to jump from a method to the next one?
推荐答案
我认为这就是您要找的:
I think this is what you're looking for:
键入 ctrl-6 以激活跳转栏"中的显示文档项目".然后开始键入您要查找的方法的一部分以缩小结果范围.
Type ctrl-6 to activate the "Show Document Items" in the "Jump Bar". Then start typing part of the method you are looking for to narrow the results.
示例:
直接跳转到- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
键入ctrl-6,键入cellFor",向下箭头以突出显示该方法,然后按Enter.编辑器将直接跳转到该方法.
Type ctrl-6, type "cellFor", arrow down so the method is highlighted, and press Enter. The Editor will jump right to that method.
顺便说一句,您可以使用ctrl-1、ctrl-2、ctrl-3 等访问跳转栏"的不同部分.
Incidentally, you can use ctrl-1, ctrl-2, ctrl-3, etc. to access the different sections of the "Jump Bar".
这篇关于有没有办法跳转到 Xcode 中的特定方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!