What is Target in Xcode?

I was always wondering what’s for these goals? What is it all about? What's the point? I never had to fight them, but I obviously can. Why would I want this, and what can I do with them? What is their purpose?

+4
source share
2 answers

Each project can create multiple executables or libraries, or invoke a makefile or shell script to create β€œmaterial”. Each one is a Target.

In one iPhone project, I have a separate goal for each static library in my home SDK and shell script for creating Doxygen documents. Another project includes two goals: one for the application used by ordinary users, one for administration and a management version.

In the first example, I need to build each library, and then link all the static libraries to the test SDK application, so my test SDK application depends on all the goals of the library (but not with the documents, since I do not need to constantly regenerate them.)

In the second example, management and general versions of the application have a significant amount of code and resources. When I change one, I want to change both of them.

+2
source

The goal is a kind of "plan." It includes rules that tell the compiler what to do, which sources should be compiled, which files should be copied to the application package, which libraries should be linked.

If you want to make the free version of your application one way , to do this, you need to add a new goal.
Of course, you could just duplicate the whole project, but then you had to synchronize them if you change the code. Using different goals makes this a lot easier.

+2
source

All Articles