0

I have run into an incredibly frustrating issue. I wrote an iPhone app on one computer, and now I am trying to work on it on another computer. I zipped the project, and sent it to myself, but when I open it, it seems that none of the images came with it. When I was adding the images, I always checked the box to have the images get copied into my project. All the image files show up, but they are in red.

I tried fixing the path of one of the hundreds of images, and after doing that, the image appeared in the typical color scheme of xcode in my project. The problem was when I tried to run the code, xcode said it couldn't find the image I'd just imported.

Next, I deleted all the images, and tried importing them again. Once they were imported, they all turned red again.

Has anyone else run into this issue? Help!

coder
  • 10,460
  • 17
  • 72
  • 125
  • I assume the images were actually copied over, just not added to the XCode project. If they are in a sub-folder, e.g. resources/images, then make sure you don't add the images - rather add the folder as a reference. Then use them in iOS as folder/imagename rather than just imagename. Does that make sense? Sounds like what might be happening. – Matt H Dec 01 '11 at 19:08
  • I don't have a folder that I can access in the project called resources/images from outside xcode... – coder Dec 01 '11 at 19:15
  • Er... huh? That was "e.g.", "for example", not a specific folder name. My point was that there are two ways to add images or other files to an xcode project, and if you have lots of images, then you should be using the folder-add method rather than the image-add method. – Matt H Dec 01 '11 at 19:31

1 Answers1

1

In Finder go to where the actually code is, and see if it did in fact move the images into the project structure.

When the resources are red inside Xcode it means Xcode can not find them you can right click on them and see where it is expecting them to be located. You can also do this after you import images to make sure they are in the project structure.

Usually XCode folder structures have a "resources" folder off of the root of the source code, this is where you should put all images. I usually manually copy them in there, and then just import them into XCode from there.