What's the easiest way in Xcode to search exclusively for all writes to (or reads from) a variable


I find myself doing this from time to time and I end up just doing a search on the variable name and then looking through all the hits, skipping the ones that aren't what I'm looking for. But it occurred to me that if Xcode could reliably filter into one set or the other, it would make the process more efficient. Because quite often one only needs to know where a variable is changed in particular, so reads don't really matter then.

I can think of some ways eg. searching for "setXXX" and "XXX =" etc. but that all seems a bit clunky and imprecise. Is there a better way?

I am mostly coding in Objective-C and am looking for a way to do a static search of the source code.

Show source
| xcode   | search   2016-12-29 16:12 1 Answers

Answers ( 1 )

  1. 2016-12-30 01:12

    What I do when I want to search for a symbol in Xcode I use the built-in search tool as you suggested in your question and that is good enough for me. However, if you want better tools for static analysis of obj-c code I'd suggest XClarify from CodeGears. It became free for open source contributors and research.

◀ Go back