user532668
user532668

Reputation:

Searching within Xcode

I've had some problems with searching in Xcode, what is the best way to find and locate a method or class within a certain project?

Upvotes: 9

Views: 4458

Answers (7)

James J
James J

Reputation: 6458

command-shift-O will bring up the "open quickly" box, which searches textually and symbolically.

Upvotes: 22

Jasarien
Jasarien

Reputation: 58448

Press ⇧+⌘+O to open the 'Open Quickly...' dialogue window.

From there you can type any symbol name or filename to quickly zoom around your project.

Unfortunately, it doesn't do wildcard or partial searching (much to my frustration) so you need to know the name (or at least the beginning of the name) for it to be much use.

You can use it to open system symbols or headers too, eg, just type UITableView to view the header for it.

Upvotes: 5

Stephen Furlani
Stephen Furlani

Reputation: 6856

Pressing ⇧+⌘+F will open up Project Find. Type in what you want to find, and then in the drop-down next to it select "In Project" and press "find."

Voila! It should group the results by file for you.

Upvotes: 2

Svenito
Svenito

Reputation: 510

If you are trying to find the definition of a class from where it's being used, you can right click over the class name and select "Go to definition"

This will take you to where the class/function is defined

Alternatively there's "Find in project"

Upvotes: 2

fbrunel
fbrunel

Reputation: 506

Look on the left bar, you have a smart folder called "Project Symbols." When you click on it, it will display all the symbols (eg. classes, methods, properties) available in your project. You can even search in this folder by entering a term in the box in the upper right corner.

Upvotes: 1

Matthew Frederick
Matthew Frederick

Reputation: 22305

Project Find with the type of search set to definitions works well.

Upvotes: 2

ughoavgfhw
ughoavgfhw

Reputation: 39905

If you know the name of the method or class, a really easy way is to type it in whatever document you are in, then hold command and double-click the text. XCode will jump directly to the definition of whatever you double-clicked (even if it is not part of the project).

Upvotes: 2

Related Questions