Exclude a file from Xcode when searching

2019-04-29 00:03发布

Is it possible to exclude files in a project from Xcode when searching? I have some JSON files in my project and Xcode constantly locks up if it finds matches in these files.

标签: xcode xcode5
3条回答
Bombasti
2楼-- · 2019-04-29 00:29

I prefere to use regexp. example for excluding unit tests files "foo_unittest.cc" or "foo_test.m"

^.((?!test).)*$

dropdown fields conditions:

  • "File name"
  • "matches regular expression"
查看更多
▲ chillily
3楼-- · 2019-04-29 00:30

Xcode 9 update

Here are examples to search including or excluding file names, file extensions, etc

enter image description here

查看更多
劫难
4楼-- · 2019-04-29 00:44

You can define custom search scope for your search. Custom scope can be define, save, and reuse specific location and file criteria for searches. enter image description here

Now you can add as as many file names as you want. enter image description here

More details on how to use custom search scope can be found here- https://developer.apple.com/Library/ios/recipes/xcode_help-search_navigator/articles/adding_a_search_scope.html

查看更多
登录 后发表回答