Heres another option if you don't mind using terminal and regex, it makes project-wide searching quite fast.
This makes use of pcregrep
which is a version of grep that supports Perl Compatible Regular Expressions.
If you don't have pcregrep you can install it using brew:
brew install pcre
Once its installed you can cd into your project root and run this command in terminal, (Note the trailing .
):
pcregrep -rnI --buffer-size=100000000 '^(.)*\btableViewCell \b((?!reuseIdentifier).)*$' .
It will list the file names and line numbers where a tableViewCell is declared and is missing a reuse identifier.
It prints out results in the terminal like this:
// this is the terminal prompt and the command we entered to search
myUser$ pcregrep -rnI --buffer-size=10000000000 '^(.)*\btableViewCell \b((?!reuseIdentifier).)*$' .
// This is the path to the matched file, followed by the line number with the match, followed by a preview of the matched line
./MyProject/Source/UI/MyController/Base.lproj/MyAccountTableViewCell.xib:13: <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="71" id="B6A-LV-CH7" customClass="MyAccountTableViewCell">
An explanation:
- pcregrep - The program that will be parsing source files looking for matches.
- -rnI - (r) search recursively - (n) print line number in file of match. (I) ignore binary files.
- --buffer-size=100000000 - sets a larger buffer for parsing larger files. (was necessary for some files in my projects)
Regex: ^(.)\btableViewCell \b((?!reuseIdentifier).)$
- ^ - match position at start of line
- (.)* - match anything at the start of the line unlimited times
- \btableViewCell \b - match the word 'tableViewCell ' with trailing space exactly
- ((?!reuseIdentifier).) - match lines where 'reuseIdentifier' is not found
- *$ - followed by any text and the end of the line