Use the Find Command in Xcode - dummies

By Neal Goldstein, Dave Wilson

Need to track down a single symbol or all occurrences of a symbol in a file or class in your iOS code? You can easily locate what you’re looking for in Xcode by choosing Edit→Find→Find or pressing Cmd+F, which opens a Find toolbar above the Editor pane to help you search the file in the editor.

For example, as shown in this figure, the deveopler entered viewDidLoad in the Find toolbar. Xcode found six instances of viewDidLoad in the source editor and highlighted them. (Admittedly, the first highlight is a tad darker.)

You can use Find to locate something in a file in Xcode.
You can use Find to locate something in a file in Xcode.

You can jump from one instance to the next by pressing Cmd+G. Or you can use the Previous and Next buttons (left and right arrows) on the Find bar.


Click the Find pop-up menu on Find toolbar and choose Replace to do a file-level replace.

Click the magnifying glass in the Search field in the Find toolbar to display a menu that allows you to show or hide the Find options. For example, you can choose to ignore or match the case of the text in the Search field. Changes you make to this set of options remain persistent for future searches.