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?
I realize this is quite old, but I'd like to suggest to those of you who happen to also code other languages on your computer and choose to use Sublime Text 2 (which is wonderful) to do so, just open your iOS project's folder in Sublime and use the find all feature. Very fast, very reliable.
This was what I did to remove unused image resources from one of my larger projects.
~ Happy Coding =]
Open the project folder in sublime text and search in all files, very easy and convenient.
You can just change the search scope in Xcode by defining a new scope. Go to the search panel and below the search bar there is an icon that has three dots (probably defaulted to "In Workspace"). Click that and under SEARCH SCOPES, click "New Scope". Define it to be "Name" / "ends with" / ".xib" .
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
I had the same problem and I resolved it using some console commands.
1) Open Terminal on your Mac
2) run "grep -i -r --include=*.xib "searchtext" /your/project/path" command
It will search in the path "/your/project/path" and will print the complete path of all files xib that use the "searchtext".
Hope this will help you!
U may use this function in your bash profile:
function grep_xib {
grep -i -r --include=*.xib "$1" .
}
Then just call in terminal "grep_xib TEXT_TO_FIND". It's easier.
To create a .bash_profile on your mac follow this steps: