如何在 Xcode 中找到 Objective-C 函数的用法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13176961/
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
How do I find usages of an Objective-C function in Xcode?
提问by krishonadish
The title pretty much sums it up, normally in an IDE like Eclipse or Intellij, you can highlight/right-click on a method and click on option like "Find Usages", but I don't see an equivalent option in Xcode.
标题几乎概括了它,通常在 Eclipse 或 Intellij 等 IDE 中,您可以突出显示/右键单击方法并单击“查找用法”等选项,但我在 Xcode 中没有看到等效选项。
采纳答案by JoshRagem
EDIT: after reading your question again, I think you are looking for these answers: Find method references in Xcode
编辑:再次阅读您的问题后,我认为您正在寻找这些答案: 在 Xcode 中查找方法引用
The answer by Francisco Garcia shows advanced search options that you can find by clicking the little magnifying glass in the search tab.
Francisco Garcia 的回答显示了高级搜索选项,您可以通过单击搜索选项卡中的小放大镜来找到这些选项。
You can check for symbol references; this would list all the calls you have to a method.
您可以检查符号引用;这将列出您对方法的所有调用。
----------- old answer ------------
----------- 旧答案 ------------
If you hold down option and click on something, you can see some helpful hints and a link to documentation.
如果您按住 option 并单击某些内容,您可以看到一些有用的提示和文档链接。
If you click on something that you have defined, it is helpful enought to link you to the file you declared it in.
如果您单击已定义的内容,将您链接到您在其中声明它的文件会很有帮助。
回答by GeneralMike
I think you're looking for the Quick Help Inspector. Make sure you have the Utilities Panel open (the toolbar that shows up on the right side of the screen). Mouseover the tabs along the top of the panel, and one of them will say "Show Quick Help Inspector". Click on that one, then highlight the method you are interested in, and the panel will display some of the basic information you are looking for.
我认为您正在寻找 Quick Help Inspector。确保您打开了实用程序面板(显示在屏幕右侧的工具栏)。将鼠标悬停在面板顶部的选项卡上,其中一个会显示“显示快速帮助检查器”。单击那个,然后突出显示您感兴趣的方法,面板将显示您正在寻找的一些基本信息。
If that doesn't tell you what you are looking for, you can also search in the Apple docsfor your method name, but sometimes that can be hard to understand if you're totally new to developing on a Mac.
如果这不能告诉您要查找的内容,您还可以在Apple 文档中搜索您的方法名称,但有时如果您完全不熟悉在 Mac 上进行开发,这可能很难理解。
I usually just do a Google search on the method name. That usually produces links to a bunch of other SO questions with a ton of explanations from other users in everyday terms that are much easier to understand for new users.
我通常只是对方法名称进行 Google 搜索。这通常会产生指向一堆其他 SO 问题的链接,其中包含来自其他用户的大量日常用语解释,这些解释对新用户来说更容易理解。