在 Xcode 中搜索文件

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

Search file in Xcode

xcode

提问by Mircea Ispas

I use xcode search to quick open files in project. It works very good when the files are in current project, but when I have one project that includes other sub-projects it searches only in files from current project. Is it possible to search a file in all files from all sub-projects? I don't like to open a sub-project every time when I want to search a file that is not included in main project.

我使用 xcode 搜索来快速打开项目中的文件。当文件在当前项目中时它工作得很好,但是当我有一个包含其他子项目的项目时,它只在当前项目的文件中搜索。是否可以在所有子项目的所有文件中搜索一个文件?我不喜欢每次要搜索主项目中未包含的文件时都打开子项目。

Thanks

谢谢

回答by PiTheNumber

In xcode on left pane in the project navigator at the bottom there is a search field. In the documentationit is called filter bar.

在底部项目导航器左侧窗格的 xcode 中,有一个搜索字段。在文档中它被称为过滤器栏。

According to Inder Kumar Rathorethe shortcut is ?+ ?+ O.

因德尔·库马尔·拉索的快捷键是 ?+ ?+ O

project navigator, filter bar

project navigator, filter bar

Also see xcode: search by file

另请参阅xcode:按文件搜索

回答by Inder Kumar Rathore

Shortcut to search a file ?+ ?+ O

搜索文件的快捷方式?+ ?+O

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

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

回答by Philip Regan

I'm not sure I understand the difference between a project and a sub-project, but Shift+Cmd+Fwill bring up the search whose scope is everything included in the project window and not just the active file. If you are talking about linked files in other projects, I think you're still stuck opening those projects to search.

我不确定我是否理解项目和子项目之间的区别,但Shift+Cmd+F会调出搜索,其范围是项目窗口中包含的所有内容,而不仅仅是活动文件。如果您在谈论其他项目中的链接文件,我认为您仍然无法打开这些项目进行搜索。

回答by Eiko

You could include the source in your project without copying it or adding it to the target.

您可以将源包含在您的项目中,而无需复制它或将其添加到目标中。

Or have a look at XCode 4 if you are a registered developer.

或者,如果您是注册开发人员,请查看 XCode 4。

回答by Taryn

The search pane in XCode 4.2 has a 'Find in' section which includes the checkbox []And linked frameworks.

XCode 4.2 中的搜索窗格有一个“查找范围”部分,其中包括复选框 [] 和链接的框架。

If (and only if) your framework dependencies are on the library's project file, and not on the library binaries, this will search both headers and source of the frameworks.

如果(且仅当)您的框架依赖项在库的项目文件上,而不是在库二进制文件上,这将搜索框架的头文件和源代码。