Xcode 按文件或类名搜索

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7332262/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:53:47  来源:igfitidea点击:

Xcode search by file or class name

xcode

提问by OckhamsRazor

I would like to search for all .xib files in a particular xcode project but I don't know how to do this on xcode. Also, suppose I want to search for a particular file, e.g. Test.h, how do I do this? I know how to do this using linux, but that gives the structure of the filesystem, and not of the xcode project.

我想搜索特定 xcode 项目中的所有 .xib 文件,但我不知道如何在 xcode 上执行此操作。另外,假设我想搜索特定文件,例如 Test.h,我该怎么做?我知道如何使用 linux 来做到这一点,但这给出了文件系统的结构,而不是 xcode 项目的结构。

回答by Saran

In xcode on left pane at the bottom there is a search field, just type xib, it should list all xib files. Same with other type of searches as well.

在底部左侧窗格的 xcode 中有一个搜索字段,只需键入 xib,它就会列出所有 xib 文件。与其他类型的搜索相同。

Place your cursor in this "Filter" with a keyboard shortcut: ?+?+ J, or by choosing from the File Menu Edit> Filter> Filter in Navigator

使用键盘快捷键将光标置于此“过滤器”中: ?+ ?+ J,或从文件菜单中选择Edit> Filter>Filter in Navigator

like this

像这样

Edit:

编辑:

You can even use wildcards. For e.g., *m*1.x* will filter SampleXib1.xib, It's also incase-sensitive.

您甚至可以使用通配符。例如,*m*1.x* 将过滤 SampleXib1.xib,它也区分大小写。

回答by Inder Kumar Rathore

To search a file/class ?+ ?+ O(Command + Shift + O)

搜索文件/类?+ ?+ O(Command + Shift + O)

To See the current opened file in Project Navigator ?+ ?+ J

在项目导航器中查看当前打开的文件?+ ?+J

To go to line number in a file use ?+ L

要转到文件中的行号,请使用?+L



Note: This partially answers the question, to see all .xibyou can search it in project navigator as mentioned by one of the answers. But I think these shortcuts are awesome!



注意:这部分回答了问题,以查看.xib您可以在项目导航器中搜索的所有内容,如答案之一所述。但我认为这些捷径很棒!

回答by Kumar Summan

Type your search keyword in the text field at the very bottom of the Project Navigator pane on the left.

在左侧 Project Navigator 窗格最底部的文本字段中输入您的搜索关键字。

File search in Project Navigator

项目导航器中的文件搜索