Could not load the image referenced from a nib in the bundle running on device

后端 未结 30 2047
挽巷
挽巷 2020-12-07 18:24

SplitView[1290:307] Could not load the \"canary04.png\" image referenced from a nib in the bundle with identifier \"xx.co.mycompany.ipad.SplitView\"

相关标签:
30条回答
  • 2020-12-07 19:12

    I've encountered this issue when I was trying to set image of an imageView on Interface Builder (.xib) file.

    (I was using Image Assets)

    I've had 2 images with theImage.jpeg and theImage@2x.jpg Interface Builder could be able to display true images at compile time with these jpg / jpeg formats. But I've got this error in the runtime:

    Could not load the "theImage" image referenced from a nib in the bundle with identifier "org.etc.etc"
    

    Then I changed my image files formats to .png and it worked!

    Try this solution too if you have different formats for images you try to set.

    0 讨论(0)
  • 2020-12-07 19:14

    Check your image name. If it contains some spaces then image will show while running in simulator but not in the device. While running it checks Case sensitive name etc.

    0 讨论(0)
  • 2020-12-07 19:16

    Solution 1 :

    In my case I had copied folder containing images and even checked "Destination : copy items if needed". However it has not been added to "Copy Bundle Resources" of "Build Phases".

    You can add images as follows :

    1. Select Targets
    2. Select "Build Phases" tab
    3. Select "Copy Bundle Resources"
    4. Click on "+" (Plus) button just beneath it
    5. Locate images and add it

    Screenshot for solution 1

    Solution 2 :

    Delete images by selecting "Move to thrash". Again add images in your project with "Destination : copy items if needed" checked.

    Note : Make sure that you add images in Assets.xcassets folder and not outside it.
    
    0 讨论(0)
  • 2020-12-07 19:19

    I had this problem when I upgraded to Xcode 4.4.1. I found that although I had deleted the images (and corresponding buttons, etc.) in the storyboards, there was still mention of them in my storyboard files (in a tabBarItems field). I manually commented them out (), Product -> Clean, and I didn't get the errors any more.

    I knew there must be bogus references in the storyboard as I had previously deleted my TabBar and the current App worked without problems, just with annoying messages in the console.

    0 讨论(0)
  • 2020-12-07 19:19

    2015 - Still having this problem. I was referencing an image that no longer existed in one of tabbed buttons.

    Solution: Simply inspect all your buttons, UIImage etc. and make sure that the image that you are referencing actually exists within your project.

    0 讨论(0)
  • 2020-12-07 19:20

    Try cleaning the project and make sure the info.plist matches the xx.co.mycompany.ipad.SplitView

    0 讨论(0)
提交回复
热议问题