I have created a projects witch contain two targets ( i have duplicate Target1 to have Target2). i have many images in the project. I would like to associate some images to one target and some others to the second target. I doing this by selecting one image.
my question:can i associate a fonder of images to a Target ? if yes how i can do this ?
thanks for your answers.
Yes, it’s possible: well folder itself has no target membership but you can easily associate all files from one folder to one target and files from other folder to the other target. Files in these folders can have the same names of course.
You can have two separate folders on disk, let’s say images_t1 and images_t2.
Drag images_t1 folder into project tree and when asked for “add to target” you only check Target1 checkbox. For images_t2 you only check Target2 checkbox – that’s it.
I just retested it and target membership of imported files (inside the two folders) is correct.
But note, if you are planning to use this images with Interface Builder you might run into minor XCode bug – mixing images. There is a workaround for that, but it’s not pretty. Check Xcode 4, Interface Builder, two targets with seperate .xib (image resources with same names).
This bug is visible only during .XIB editing – everything is fine once apps are compiled.