Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load the image referenced from a nib in the bundle with identifier (again)

(Xcode 6.0.1, iOS 7.1.1, iPad2)

  • Added three new images to Images.xcassets
  • Checked "Copy items if needed" on import dialog
  • Build phases -> Copy Bundle Resources: Deleted and re-added Images.xcassets
  • Checked image names to avoid case sensitivity issues
  • Cleaned and rebuilt.
  • Quit Xcode and restarted
  • Deleted app from device for clean install

Trying to set the image as a button background.

Images are showing in the simulator, but not on a device. This leads me to believe that they're not being bundled with the app, despite the fact that I've included images.xcassets in the build.

I would like to check and see if the three new image sets are included, but there does not seem to be a way to drill down into images.xcassets within the "Copy Bundle Resources" branch under "Build Settings."

I am setting the image background in storyboard by clicking on the image view, selecting the "Attributes Inspector" button, and then selecting the image name in the drop-down under "Background."

Other images work; it's just the newly added images that don't show up.

I'm stumped... any advice?

like image 392
kmiklas Avatar asked Oct 20 '14 16:10

kmiklas


2 Answers

In my case the problem was that I used some .JPG images (which I know is not the ideal format but I wasn't worried with that yet since I was only doing some initial development).

I converted one of the images to .PNG (using Preview), imported and the problem was resolved!

like image 109
Ricardo Barroso Avatar answered Sep 26 '22 07:09

Ricardo Barroso


It was dots in the file name!

The new images were named with dates appended to the end of the filename, using dots to separate month, day and year; like so:

  • puppy.10.17.2014.png
  • kitten.10.17.2014.png
  • chick.10.17.2014.png

I stripped out the dots, and named the files like so:

  • puppy.png
  • kitten.png
  • chick.png

What a headache... I hope this helps someone out there in cyberspace!

like image 35
kmiklas Avatar answered Sep 23 '22 07:09

kmiklas