Search code examples
iphonexcodexcode4

Can't add images to iPhone in xcode


I switched computers, so to copy my projects from xcode, I uploaded the whole project to Dropbox. When I to access the project all my image files where displayed in red with an empty box next to it. I'm assuming its because I forgot to check the "Copy in to Project" box when I initially added the images. I deleted the images from the folder and tried to re-add them. Still, I just have the file displayed in red with an empty box next to it. I then deleted the file again from xcode, renamed it, and tried again. Still no luck.

After cleaning the project, I gave up. Anyone else run into this problem and know how to fix it?

Thanks


Solution

  • Easiest thing to do is remove the files in red from your XCode project and drag the images from the Finder back into your XCode project, which will set the paths correctly.

    The smarter thing to do is to use the File Inspector to point the missing files (in red) to where the images actually live.

    Either way works. :-)