Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode 4 list of files with target

Tags:

xcode

xcode4

In Xcode 3 it was easy to get an overview of which files are activated for current active target. I love the new feature in Xcode 4 where you can see all the targets a specific file is active for (its like an inversed view of xcode 3). Is there some mysterious way of getting that good ol' view back?

It would be really handy when specifying test-files and nibs for different targets...

Image from that good ol' list in xcode 3:

enter image description here

like image 538
hfossli Avatar asked Mar 24 '11 17:03

hfossli


People also ask

How do I see targets in Xcode?

When you create a new project from a template, Xcode adds one or more targets to the project automatically. For example, the multiplatform app template contains separate targets for an iOS app and Mac app. To view the targets in a project, select the project in the navigator area.

How do I add files to target in Xcode?

I include them in the project by right-clicking on the project folder in the project view in Xcode, and selecting "Add Files to ...". I then navigate to the folder containing the source files, click on the folder and select "Add." With the options "Create folder references" and "Add to target [target name]".

What is the difference between project and target in Xcode?

A project is a set of files and general preferences. A target is a subset of the files, and specific preferences (which override the project preferences). Each target builds a product, which may be a library, executable, or framework.


2 Answers

Expanding on tomwhipple's answer, there is a way to see all the files that are not part of a target.

Go to -> Build Phases -> Compile Sources and hit the '+' button. This will show you all the files that are not part of the target. However, this list is pretty cluttered with things that really shouldn't be in your target. But you can type ".m" in the search bar to only show the classes that aren't included.

Screenshot

like image 160
Nate Petersen Avatar answered Sep 20 '22 01:09

Nate Petersen


By Target: Navigate to the project, then select the target and expand the various build phases. It's more specific because it shows you what role the file(s) play in the target.

By file: Select the file in the navigator and open the Utility pane. The targets list is shown there (but only for that one file).

like image 21
Joshua Nozzi Avatar answered Sep 21 '22 01:09

Joshua Nozzi