Reputation: 4575
I have two target builds in my iPhone app project, and I want to build each one with a different Default.png for the load screen. At the moment I am having to place the file with the correct name in the project folder, build, then swap it out with a different one and build the other target.
Is there an easier way?
Thanks
Upvotes: 1
Views: 789
Reputation: 11
If you have 2 different Default.png files, you should be able to specify explicitly which one of them each target should copy to the application bundle.
If you expand a target in Xcode, there should be 3 subcategories where one of them defines all resources that are copied. This is the category that should contain the desired Default.png. Delete it from both your targets, and then drag each Default.png into the appropriate target to make sure they both reference the correct file.
Drag is ok but be careful to:
when adding the resource.
Is it right?
Upvotes: 1
Reputation: 1430
If you have 2 different Default.png files, you should be able to specify explicitly which one of them each target should copy to the application bundle.
If you expand a target in Xcode, there should be 3 subcategories where one of them defines all resources that are copied. This is the category that should contain the desired Default.png. Delete it from both your targets, and then drag each Default.png into the appropriate target to make sure they both reference the correct file.
Upvotes: 3
Reputation: 4985
It seems like you should be able to do this with a Custom Build Rule. See: this article. You'll definitely have to adapt what's been done. Also, I'm not sure this qualifies as easier.
If I were going this route, I'd try to insert a script into the build process that interrogates the target and copies the correct image file to Default.png.
Upvotes: 1