Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text search though all .xib files in Xcode?

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.


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 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 =]


I may be daft, but using spotlight works great for me on this one.


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:

  • Start up Terminal
  • Type "cd ~/" to go to your home folder
  • Type "touch .bash_profile" to create your new file.
  • Edit .bash_profile with your favorite editor (or you can just type "open -e .bash_profile" to open it in TextEdit.
  • Type ". .bash_profile" to reload .bash_profile and update any functions you add.