Images displayed on the simulator but not on the iPhone

Therefore, when I launch the application from the device, images appear, and everything works fine. However, when I go to the device, I launch about 10 of 38 shots that are not displayed. I pull out the names for the images from the sqlite database, and I already checked, and the names are correct, random and that’s it. I checked the kit, and the images are correct there.

Is the memory game playable? I'm not quite sure what else could lead to this.

Thanks!

Solution: Somehow, the files were not saved properly and could not be opened, for example, using photoshop or paint. So when the files were not open, they did not appear ... Thanks for helping everyone!

+7
source share
4 answers

The simulator accepts a wider range of image formats. Sometimes you had a certain type of file that your device cannot display. Double check 10 files that are looking for some differences from others.

+6
source

The first thing to check is the case of the strings you use to refer to resources. The iPhone is case sensitive, but the simulator is not.

Oh, I just saw that you checked the case. Better write down all your UIImage creation challenges!

+43
source

Yes, memory absolutely plays it. Check your UIImage creation calls and make sure they don't return empty. Also, check to see if you received a memory warning in the console window.

+2
source

In general, if the memory size in the memory was the culprit, your application will crash with a low memory error on the device. However, it seems that the images simply are not displayed.

Another thing that may go wrong is the size of the images. UIViews on iPhone can only be smaller than the maximum texture size supported by the GPU. Apple claims it is 1024 x 1024, but I found it more like 2048 x 2048 even on the original iPhone. You may be creating a view for some of these images that is larger than this size in one dimension, but your Mac has a larger maximum texture size on its GPU and therefore displays fine in the simulator.

+1
source

All Articles