在 Xcode4 中查找变量或方法的所有引用 [英] Finding all references of a variable or a method in Xcode4

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

问题描述

这里有一个类似的问题,但我做不到使用 XCode 4 中的答案.我用谷歌搜索了它,但我也找不到任何有用的东西.您获取这些信息的有效方法是什么?

There'a a similar question here but I couldn't make use of the answers in XCode 4. I googled it but I couldn't come up with anything useful either. What's your effective method of getting this information?

推荐答案

在项目中查找,但如果您想在任何地方更改名称,最好使用 Refactoring 菜单.

Find in project, though if you are searching to change the name everywhere, better would be to use the Refactoring menu.

您可以使用重构来查找引用特定变量的位置.选择变量并选择 Edit->Refactor->Rename.在重构屏幕中,重命名变量(只需在末尾添加 _ 或其他内容)并单击预览.它将在项目中的任何地方显示引用了变量.单击每个文件以查看调用变量的行.完成后只需取消重构即可.

You can use Refactoring to find where a specific variable is referenced. Select the variable and choose Edit->Refactor->Rename. In the refactoring screen, rename the variable (just add _ at the end or something) and click preview. it will show everywhere in the project that variable is referenced. Click on each file to see the lines where the variable is called. After you're done just cancel the refactor.

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

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