@小米 同学,今天问我两者区别
一个习以为常的东西,两者的内涵却不能清楚明白地讲出来,这也突现了自己对知识细节的忽视,
本篇文章,把网友给的解答展示出来,并且对Targets概念以及Xcode工程内多Targets应用,都记录下来了,有点乱,凑合着吧,哈哈,望见谅!
在stackoverflow上发现有人问了同样的问题, 问题及回答如下:
issue:
Excuse my ignorance, but what is the difference in Xcode 4 between the Deployment Target field inder "Targets" and the deployment target under "Project"?
What happens if my project deployment target is 3.2, and my IOS Application is 4.0? Or vice versa?
Answer:
Target settings override project settings. Project settings are valid for all targets whose settings haven't been overridden.
通过这个回答,我们大概可以理解了两者的关系了。
相信很多人都注意到XCode中, 有个Target的概念. 这在很多地方都有所体现, 比如打开一个工程后, 左侧的列表中有Targets一项, 而在工程界面的顶部菜单中, project里面也有多个涉及到Target的项目, 那么这个Target到底是什么呢?
Apple 的人是这样说的:“ Targets that define the products to build. A target organizes the files and instructions needed to build a product into a sequence of build actions that can be taken.”