Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude a file from Xcode when searching

Tags:

xcode

xcode5

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.

like image 366
Berry Blue Avatar asked Jul 07 '14 05:07

Berry Blue


3 Answers

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

like image 154
rishi Avatar answered Nov 12 '22 06:11

rishi


Xcode 9 update

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

enter image description here

like image 40
Fangming Avatar answered Nov 12 '22 07:11

Fangming


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"
like image 1
Andrii Tishchenko Avatar answered Nov 12 '22 07:11

Andrii Tishchenko