问题
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.
回答1:
You can define custom search scope for your search. Custom scope can be define, save, and reuse specific location and file criteria for searches.

Now you can add as as many file names as you want.

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
回答2:
Xcode 9 update
Here are examples to search including or excluding file names, file extensions, etc
回答3:
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"
来源:https://stackoverflow.com/questions/24603639/exclude-a-file-from-xcode-when-searching