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

查看:114
本文介绍了在 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. 转到调用者"子菜单以查看调用所选方法的所有方法的列表,然后单击其中任何一个以跳转到该文件和方法.

在图片中...

几点说明:

  • 您也可以对属性执行此操作.
  • 请注意,当您从 Callers 菜单中选择调用方法以跳转到调用方法的位置时,Xcode 仅突出显示 first 调用.每个调用方法只会在调用者"列表中显示一次,即使它包含对您的方法的多次调用.因此,如果您尝试在应用程序中调用方法的每个地方进行一些更改,请注意不要错过调用方法包含对您感兴趣的方法的两次调用的地方.
  • 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天全站免登陆