This isn't a super critical issue, but in my project, I have multiple targets for different versions of the app. I can add the 4" retina launch image "[email protected]", but I can't specify different versions of it for each target like I can the other images; changing it in one target will change it (incorrectly) in the other targets. Seems like an xcode 4.5 bug, but wanted to ask in case I've missed something. As it is, the work around is to simply change the image before each build when I switch targets. My fear is that one of these days, I'm going to forget to do that;-) Thanks.
1 Answers
While I haven't verified the bug you describe, this seems simple enough to work around. All iOS does is look for Default.png (etc.) in your application bundle when it launches.
If you can't get the Target Info pane to do what you want, you can just override it by replacing the [email protected] after the rest of Xcode has had its way.
Here's my suggestion. You'll need to do this for each target.
- Move your [email protected] images to subdirectories.
- Add a Copy Files build phase to each target at the end.
- Set the build phase to copy to the Resources directory.
- Drag the appropriate [email protected] into the build phase.
Try this out and see if it will do what you need. If it works but gives you a build warning, you can use a Script Phase instead, and something like this:
cp ${PROJECT_DIR}/your-subdirectory-here/[email protected] \
${CODESIGNING_FOLDER_PATH}/[email protected]
The script phase has the advantage that you can specify the name of the destination file; you don't really need to put your images in subdirectories.
That said, unless you're comfortable with scripting I suggest you try the Copy Phase first. No point playing with something you're not comfortable with if it isn't going to work anyway.