What are “targets” in Xcode?

风流意气都作罢 提交于 2019-12-03 03:15:39

A target basically defines what it is you are building and how you are building it. You can add more targets if you would like to build more than one thing. This usually makes sense if you need to build several related things from the same project.

For instance, you might want one target for a full, paid version of an application, and another target for a reduced, free version of an application. Both targets would include much of the same code and resources, but some of the settings would be different and you might have different files included with each.

Targets are simply different ways of building a product. You have your source files, and you have your output, and there are several ways that you can get from A to B.

An Xcode project may contain a number of source files which can be built do produce a number of different products.

For example, you could build an executable using some of the files, or you could build a library (Framework) from some of the files, or a unit test library, or with different build flags.

Most projects will have a single target, but some are more complex than others.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!