Alex Rivera | Logout

Text search though all .xib files in Xcode?

Asked 2010-10-18T21:03:57.440
57

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!

Edit
Report

1 Answer

17

Here is my handy command that never fails me. Run it from the project directory in Terminal.

find . -name "*.xib" -exec grep "text to look for" {} \; -print

answered 2013-01-29T13:11:44.497

Your Answer