Search code examples
iphonexcodeimageipadbuild

Does Xcode compile images?


What I did is as follows.

  • Imported (including copy items) 20 images to my project. (using drag & drop)
  • Selected Device for building the project - alt text
  • Build the project.
  • Installed on device (in my case iPad)
  • Ok. Now Application is installed - I started iPhone Explorer (to explore & check whether images are copied into .app or not).
  • I found that images are copied properly but when I opened images I found them empty?
  • Here is the video that demonstrates the empty images.

alt text

My Question is

  • Does Xcode compiles images?
  • How does Xcode copies images into .app file while building?
  • Why we can not see the images within .app?
  • Once application is build, how to ensure that images are copied properly?

Solution

  • When Xcode builds your app, it compresses the PNG images in your project with a tool known as pngcrush. Then it stores them in your application bundle (the .app file), as you observe with iPhone Explorer. This compression removes enough data from your images to cause them not to display when you try to view them on your Mac. They will look fine on your devices and simulator, though.

    I'm not sure how to check your images per your last question, other than by checking that they show up correctly on a device.