简体   繁体   English

一个在XCode中用于多个应用程序的项目

[英]One Project For Multiple Applications in XCode

I am trying to use the approach of having a single project that uses different targets with different plist files. 我正在尝试使用单个项目的方法,该项目使用具有不同plist文件的不同目标。 However, each target has a different set of launch and icon images. 但是,每个目标都有一组不同的启动图像和图标图像。 I cant however use a duplicate set of these since adding a duplicate image when the same name gives the error that its already in use. 但是,我不能使用这些副本集,因为当相同名称给出其已在使用的错误时添加了副本图像。 Is there anyway around this in xcode? 在xcode中是否有解决方法?

To save the file, either provide a different name, or move aside or delete the existing file, and try again.

You should use Xcode 5's assets catalogs. 您应该使用Xcode 5的资产目录。 You can define a different assets catalog for each target, and in each assets catalog you can define different launch images. 您可以为每个目标定义不同的资产目录,并且在每个资产目录中可以定义不同的启动映像。 Names are handled by the content generator. 名称由内容生成器处理。

You can mix asset catalogs, so you can have, for example, one shared catalog for shared images, and individual ones for each different target, where you can have distinct icons and launch images. 您可以混合资产目录,因此,例如,可以有一个共享目录用于共享图像,而每个目录都有一个单独的目录,可以在其中具有不同的图标和启动图像。

OK, so I have changed my approach and found the easiest and a simple solution which I ignored before. 好的,所以我改变了方法,找到了我以前忽略的最简单和简单的解决方案。 All you have to do is keep the file names same but keep the files in different folders. 您要做的就是保持文件名相同,但将文件保留在不同的文件夹中。 And when adding them to project, check the target to which the files belong to and uncheck other targets. 并将它们添加到项目中时,请检查文件所属的目标,然后取消选中其他目标。 See the image. 看到图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM