如何在Xcode中找到Objective-C函数的用法?

时间:2022-09-07 08:47:25

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中的等效选项。

2 个解决方案

#1


8  

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.

如果您按住选项并单击某些内容,则可以看到一些有用的提示和文档链接。

If you click on something that you have defined, it is helpful enought to link you to the file you declared it in.

如果单击已定义的内容,则有必要将您链接到您声明的文件。

#2


-1  

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.

我想你正在寻找快速帮助检查器。确保打开“实用工具”面板(显示在屏幕右侧的工具栏)。将鼠标悬停在面板顶部的选项卡上,其中一个将显示“Show Quick Help Inspector”。单击那个,然后突出显示您感兴趣的方法,面板将显示您正在寻找的一些基本信息。

If that doesn't tell you what you are looking for, you can also search in the Apple docs for 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.

我通常只是对方法名称进行谷歌搜索。这通常会产生一系列其他SO问题的链接,其中包含日常用户的大量解释,这些解释对于新用户来说更容易理解。

#1


8  

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.

如果您按住选项并单击某些内容,则可以看到一些有用的提示和文档链接。

If you click on something that you have defined, it is helpful enought to link you to the file you declared it in.

如果单击已定义的内容,则有必要将您链接到您声明的文件。

#2


-1  

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.

我想你正在寻找快速帮助检查器。确保打开“实用工具”面板(显示在屏幕右侧的工具栏)。将鼠标悬停在面板顶部的选项卡上,其中一个将显示“Show Quick Help Inspector”。单击那个,然后突出显示您感兴趣的方法,面板将显示您正在寻找的一些基本信息。

If that doesn't tell you what you are looking for, you can also search in the Apple docs for 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.

我通常只是对方法名称进行谷歌搜索。这通常会产生一系列其他SO问题的链接,其中包含日常用户的大量解释,这些解释对于新用户来说更容易理解。