[英]PNG images ok on simulator but don't display on device
My iphone app pulls in about 300 images from a bundle, and then on one of my view controllers it displays one at random. 我的iPhone应用程序从一个捆绑包中提取了大约300个图像,然后在我的一个视图控制器上随机显示一个。 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).
这在模拟器(xcode 4.3.3 / iphone 5.0或5.1模拟器)上工作正常,但是当我将它推到我的设备(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 以下是所请求的软件包的屏幕截图: https : //skitch.com/bobsmells/eeask/flagquiz.xcodeproj-afghanistan.png
Any ideas? 有任何想法吗?
Issues have been known in the Xcode compression of PNG files. 在PNG文件的Xcode压缩中已知问题。 I personally submitted an App to the App Store that refused to be accepted because it had corrupted PNG files - which they were not.
我个人向App Store提交了一个拒绝被接受的应用程序,因为它已经损坏了PNG文件 - 它们不是。 Turned out Xcode was corrupting them on build.
原来Xcode在构建时破坏了它们。
Maybe this is the same issue. 也许这是同一个问题。
Go to Project -> Build Settings and try setting "Compress PNG Files" to NO. 转到项目 - >构建设置,然后尝试将“压缩PNG文件”设置为NO。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.