I have made an app with a certain functionality and a certain graphical look.
For example, a custom tableview cell is loaded from a Xib file and has a UIImageView as a background image, loaded with a Pink image ("customcell.png") from the resources group.
Now, I have duplicated the original Target to create a blue version of the app. Also, the new Target is using its own Info.plist file with its own bundle identifier.
I wanted the UIImageView inside the Xib file to use the same filename ("customcell.png"), but take a the blue version of customcell.png if the blue Target was built.
I know you can't have files with the same name in a project, even if you put it in a group (yellow folder), since that's just a logical folder.
So I created 2 blue folders (called "blue", and "pink"), each associated with the correct Target. I have put a blue version of "customcell.png" in the "blue" folder, and a pink version of "customcell.png" in the "pink" folder.
I have deleted the original "customcell.png" from the project, leaving just the 2 copies that are in the new folders.
In Interface Builder, the UIImageView has gone blank (since I deleted the original image file), so I selected "customcell.png" again from the dropdown list. It showed only 1 file of that name (not 2), and it is the blue one (don't know why).
However, when I build to any of the targets, I get an empty UIImageView and a warning:
Could not load the "customcell.png" image referenced from a nib in the bundle with identifier "com.myapp.blueversion"
(or pinkversion)
So, basically my question is, how can I use different images with the same name, associated to different targets, but having 1 Xib file that loads them appropriately?