My iphone app pulls in about 300 images from a bundle, and then on one of my view controllers it displays one at random. This works fine on the simulator (xcode 4.3.3 / iphone 5.0 or 5.1 simulator) but not when I push it to my device (iphone 3gs). The app runs and there are no errors on the log, but that part of the view where the image should be is just blank, like the color of the background.
Things I've tried:
I looked at the log produced by the build, and although that was the first time I'd examined it in detail, it had no errors and seemed to be copying the bundle across. Here's the snippet from the log:
CpResource FlagQuiz/flagimages.bundle /Users/ian/Library/Developer/Xcode/DerivedData/FlagQuiz-drrjrlxfifrmbnaissqfqxuixchb/Build/Products/Debug-iphoneos/FlagQuiz.app/flagimages.bundle
cd /Users/ian/Documents/xcodeapps/FlagQuiz
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip /Users/ian/Documents/xcodeapps/FlagQuiz/FlagQuiz/flagimages.bundle /Users/ian/Library/Developer/Xcode/DerivedData/FlagQuiz-drrjrlxfifrmbnaissqfqxuixchb/Build/Products/Debug-iphoneos/FlagQuiz.app
Here's a screenshot of the bundle as requested: https://skitch.com/bobsmells/eeask/flagquiz.xcodeproj-afghanistan.png
Any ideas?
Issues have been known in the Xcode compression of PNG files. I personally submitted an App to the App Store that refused to be accepted because it had corrupted PNG files - which they were not. Turned out Xcode was corrupting them on build.
Maybe this is the same issue.
Go to Project -> Build Settings and try setting "Compress PNG Files" to NO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With