Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode, how can I change an image file for one target?

At some point I added all of my files for all targets.

However, now I want use the same file name but a different email for my second target.

How do I do change the file?

Do I have to delete it from all targets.

like image 515
Jules Avatar asked Sep 06 '25 23:09

Jules


1 Answers

If you select a file in Xcode and look at the inspector you can select which target(s) the file belongs to.

You can have two files of the same name in the same project, they just can't be in the same folder. Now Xcode is rather poor at helping you to manage folders, but it will leave a file in a folder...

So

  1. Open your Xcode source folder in the Finder
  2. Create a sub-folder, you can name it after your target if you like
  3. Duplicate the file you wish to change for one target into that folder
  4. Back in Xcode select the file and deselect the target in the inspector
  5. Add the duplicated file, including it only for the one target. (Creating a group in Xcode is a good idea).
  6. You're done, you can edit the two versions individually
like image 55
CRD Avatar answered Sep 09 '25 17:09

CRD