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

后端 未结 30 2048
挽巷
挽巷 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:02

    Check the image name. Then check to see if you can open the image itself in paint or photoshop. If the image was created in photoshop and there were layers sometimes there is some conflict with the .png

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

    I was getting this error too. I will describe my scenario:

    I have a subdirectory "img" which has some png's in it.
    One of these png is "ic_timeprogress_000.png"

    In the storyboard (visual designer) I had an imageView and the image was set to "ic_timeprogress_000.png" (not programatically). The designer showed the imageView correctly:

    imageView in subdirectory

    Although when running the app, the error was thrown.

    So in the storyboard I changed (I insist: not programatically) from "ic_timeprogress_000.png" to "img/ic_timeprogress_000.png", which lead to not showing correctly the image in the designer but showing correctly when running (no error)

    imageView in subdirectory

    Although I alter imageView.image programatically, so this "initial image" isn't ever used.

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

    Do you have the image in a referenced folder in XCode (blue folder)? If so you have to include the folder name in the image path, something like "Images/canary04.png"

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

    I had a different problem in iOS 8. In my case the problem was that I selected Device Specific for the image set, and then selected iPad. Changing this back to Universal fixed the problem.

    This setting can be found in the images.xcassets file, in the third column show the attributes inspector for the image set.

    In this case the images wont be displayed in the storyboard or NIB file even if you have added them to images.xcassets. They also wont show in the simulator or device.

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

    I have this problem with Xcode 5, and it seems "Combine high resolution artwork" is the culprit. I opened the app bundle, and all the images were *.tiff, which caused the image to "not be found" :S

    FIX:

    Open project settings, and search in the top for "combine". Change that setting to NO.

    enter image description here

    For some reason, everyone is missing this essential fix.

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

    In my case all images where displaying fine on devices with >iOS 7 but not with iOS 6.1. The solution was that iOS7 is case sensitive but iOS 6.1 wasn't for me. I had images named like "myImageName" and also named "myimagename" witch leads my old iPhone 3 to be unable to display these images.
    So renaming them solved it.

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