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

后端 未结 30 2046
挽巷
挽巷 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 18:53

    I had the same issue, if your images are inside sub-folders, you need to choose "Create groups for subfolders" Option when you copy the resources.

    0 讨论(0)
  • 2020-12-07 18:55

    My problem was that I saved the image as .jpg and changed the name to .png (was still in jpg format). It worked with simulator

    0 讨论(0)
  • 2020-12-07 18:55

    I also met the problem that jpeg files cannot be loaded successfully, however I solved it without changing them to png format: for example, if you have an image named "bg.jpg", don't use "bg" in storyboard (this name is listed in the dropdown selection list), instead you should explicitly write "bg.jpg" in the name field.

    For programming based image view, I guess using .jpg extension like [UIImage imageNamed:@"xx.jpg"] should also work (I did't test though).

    0 讨论(0)
  • 2020-12-07 18:56

    In my case, the issue was the image format. They were 'jpg' files, while Xcode was expecting 'png' files. Changing the file format fixed the issue.

    0 讨论(0)
  • 2020-12-07 18:57
    1. Delete the blue folder where the image is.
    2. Import again and select "Copy items if needed".
    3. Select "Create Groups" NOT folders
    0 讨论(0)
  • 2020-12-07 18:59

    You can do this to check it from your storyboard, or nib. Open it as Source Code:

    enter image description here

    Then "Find" the image name in it, see if it exists but already invalid in your project, probably you have deleted or changed its name, and now it doesn't seem valid.

    enter image description here

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