我的 iPhone 应用程序从一个捆绑包中获取约 300 张图片,然后在其中一个视图控制器上随机显示一张。这在模拟器(Xcode 4.3.3 / iPhone 5.0 或 5.1 模拟器)上运行良好,但当我将其推送到我的设备(iPhone 3gs)时就不行了。应用程序运行正常,日志中也没有错误,但是那个应该显示图片的视图部分却是空白的,就像背景颜色一样。
我尝试过以下方法:
我尝试过以下方法:
- I've checked and double-checked the case of the filenames vs references in code.
- I checked the Build Phase called Copy Bundle Resources, and it's definitely set to copy the bundle to the device.
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