在 Xcode 中,您可以让它像在 Eclipse 中一样自动突出显示对所选对象的引用吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2439701/
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
in Xcode can you have it automatically highlight references to the selected object like in eclipse?
提问by Ayrad
In Eclipse when you click on a method name a variable, or an object for example, the same ones are highlighted in a specific color elsewhere in the code for easy finding.
在 Eclipse 中,当您单击方法名称、变量或对象时,相同的名称会在代码的其他地方以特定颜色突出显示,以便于查找。
Is there a similar feature in Xcode?
Xcode 中是否有类似的功能?
回答by Nick Forge
You can highlight them using a find operation:
您可以使用查找操作突出显示它们:
If you've selected a word, hit Cmd+E (find based on current selection), Cmd+F (show the find bar), then Cmd+G (find next). You can become very productive in Xcode (or any other OS X app for that matter) through judicious use of Cmd+E, Cmd+F and Cmd+G.
如果您选择了一个单词,请按 Cmd+E(根据当前选择查找)、Cmd+F(显示查找栏),然后按 Cmd+G(查找下一个)。通过明智地使用 Cmd+E、Cmd+F 和 Cmd+G,您可以在 Xcode(或任何其他 OS X 应用程序)中变得非常高效。
回答by Ayrad
If you count underlining as highlighting I would say "yes". If you select the Variable and keep the cursor there, Xcode will underline all other instanced of that variable.
如果您将下划线视为突出显示,我会说“是”。如果您选择变量并将光标保持在那里,Xcode 将在该变量的所有其他实例下加下划线。