Tsuneo Yoshioka
Tsuneo Yoshioka

Reputation: 7874

Project wide word matching search on Xcode 5

I'm using Xcode 5, and want to find a word (ex:variable name) not by substring match but by exact match (or prefix match). In file wide search (Command-F), I can use Textual search or regular expression search by clicking the arrow button just right of the glass icon and choosing "Edit Find Options...". But, I cannot find any option to search on project wide search ("Find in Project", Shift-Command-F), in Xcode 5. One thing I can do is run "grep -w" on Terminal.app. But, isn't there any way to search word in Project inside Xcode?

Upvotes: 4

Views: 4659

Answers (2)

wscole
wscole

Reputation: 53

In Xcode 6 the problem I was having was that my Framework folder wasn't being searched, even though it was clearly part of the project (but in /Library/Frameworks), and even when I had one of its files open with the string showing in the editor.

So I clicked In Project and defined a new Scope that specified "within workspace and frameworks".

Changing the scope from In Project to My Scope (as shown) even allowed me to find the search string in non-frameworks folders.

Upvotes: 3

Alladinian
Alladinian

Reputation: 35636

Well it seems that the search tool in Xcode 5 is a bit confusing for a lot of people. In my opinion Apple should have done a better work letting the user know of what is clickable and what not... That being said, here is how you access the different options:

Once we switch to the Find Navigator we see 3 components (Find>Text>Containing) enter image description here

Now, you can click on any of them to select between different options (à la jumpbar) enter image description here

And finally you can also click the In Workspace (or In Project) to change the scope of your search

enter image description here

Upvotes: 24

Related Questions