views:

26

answers:

1

This seems like such a basic task, but I'm stumped.

How, in Xcode, do you execute a textual search though (the XML contents of) all the .xib files in a project?

For example, all of our .xib files contain this string on the second line: com.apple.InterfaceBuilder3.CocoaTouch.XIB. So I'd think that searching all project files for that string would return all .xib files, but Xcode insists "0 occurrences". I've double checked that the Project Find Options look correct.

I must be missing something obvious. (Or Xcode is somehow hard-coded to skip .xib files.)

I'm trying to find all the .xib files that reference a particular class (and a text search seems like the most direct way).

Thanks!

+2  A: 

What I do is run grep in terminal:

grep -i -r --include=*.xib "TextToFindHere" /PathToSearchHere

Xcode doesn't seem to have an option to search xib files and my attempts to get Spotlight to look at them have been unsuccessful.

aBitObvious
Bingo. Don't run the search in Xcode; run it instead in Terminal.app. To make things simpler, you can drag the file icon from the title bar into Terminal.app and drop it to get the file's path, then just delete till you're back at the project root.
Jeremy W. Sherman