I’m trying to load an UIImageView with an UIImage using [UIImage imageNamed:name]. The simulator works perfectly loading the image, but running the same code on an iPad terminates with an exception (because the UIImage ends up being nil). Why is this happening?
I added the images from XCode to ‘Supporting Files/Images’.
Weird thing is that some files I added are being found ok, but these other images are not. The only difference between them is that I renamed the ones I cannot find from within XCode. I even tried removing and adding them back again, but no dice.
Case is not the issue, I already checked it.
This is on XCode 4.2 and iOS 5.
Any clues?
Thanks
Make sure that the images exist in the “Copy Bundle Resources” section of your target’s Build Phases. Whatever you do, try cleaning your build folder first (option+shift+cmd+k). Good luck!