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 -
- 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.
My Question is
- Does Xcode compiles images?
- How does Xcode copies images into .app file while building?
- Why we can not see the imag开发者_StackOverflow中文版es within .app?
- Once application is build, how to ensure that images are copied properly?
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.
As BoltClock mentioned that png files are compressed, but you can view it on MAC using a little application called iphoneapp , i use it regularly and found it useful
精彩评论