在Xcode中查找方法引用 [英] Find method references in Xcode

查看:156
本文介绍了在Xcode中查找方法引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode中是否有办法找到已调用方法或属性的所有位置?

Is there a way in Xcode to find all the places where a method or property has been been called?

例如,在Eclipse中,您可以右键单击方法并选择查找参考。 Xcode中有类似内容吗?

In Eclipse, for example, you can right-click a method and select Find references. Is there anything similar in Xcode?

推荐答案


  1. 选择您感兴趣的方法或位置文本光标在其中。

  2. 通过编辑器左上角的图标打开相关文件菜单。 (这是后退按钮左侧的按钮)。

  3. 转到调用者子菜单,查看调用所选方法的所有方法的列表,然后单击其中任何一个跳转到该文件和方法。

在图片中...

< img src =https://i.stack.imgur.com/9ccOz.pngalt =上面第3步的屏幕截图>

一些注意事项:


  • 您也可以为属性执行此操作。

  • 请注意,当您从中选择一个调用方法时调用者菜单跳转到调用方法的位置,Xcode仅突出显示第一个调用。每个调用方法只会在调用者列表中显示一次,即使它包含对您的方法的多次调用。因此,如果您尝试在应用程序中调用方法的每个位置进行一些更改,请注意不要错过一些调用方法包含对您感兴趣的方法的两次调用的地方。

  • You can do this for properties too.
  • Note that when you select a calling method from the Callers menu to jump to where your method was called, Xcode highlights only the first call. Each calling method will only show up in the 'Callers' list once, even if it contains many calls to your method. So if you're trying to make some change at every place in your application where a method is called, be careful not to miss some in places where a calling method contains two calls to the method you're interested in.

这篇关于在Xcode中查找方法引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆