2 Targets 1 Icon Name
My program has two targets and I want to correctly configure this screen:
I successfully configure the "App Icon" and "Launch Images" in .plist file, setting the key CFBundleIconFile and CFBundleIconFiles (for icon) and UILaunchImageFile (for launch Image) in the .plist file.
To see this error 开发者_运维知识库yourself, try the following:
- Create a new project
- Create two or more targets for this project
- Go to the screen above (select the project icon in XCode, in targets select the "summary" tab)
- Select an image to be the icon of this target
- The icon will be added to the project and automatically saved in the root project directory in the file system with the name "Icon.png"
- Go to another target and select another image to be the icon of this target
- Here is the problem. The system will say: "Want to replace this file?" If I say yes, it overwrites and the first target icon is replaced!!! If say no, nothing is done.
Is there a way to configure two different icons and two launch images to appear in this screen for each target? I can correctly configure it in the .plist file, but in this screen it looks like I have no image!
You need store icons in different folders.
- Create 2 subfolders in "images" (in file system, not in Xcode)
2. Create corresponding "group" (yellow folder) in Xcode and set right path for them (optional)
3. Add all icons to project (in corresponding groups)
4. Set "Target membership" (in the right panel in Xcode) to right target for each icon.
5. The info.plist file(s) should reference to right icon name.
Also be aware of:
All files from subfolders of "images" will be placed in one root folder in device's file system, so it is never mind, that images located in different folders in developer's machine. If you have files with some name in different folders, only one may be placed in final bundle. It is why you need specify "Target membership".
Do not set arbitrary names for lancher icons. Some devices may no recognize icon, if it named arbitrary, ever if it is mentioned in info.plist file (see here).
精彩评论