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

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

    Have you included the file in the target? Right-click on your Target in Xcode, select Get Info and choose the "Targets" group along the top. Make sure your intended target(s) are checked.

    Good Luck.

    EDIT: The text above should have read Right-click the file (canary04.png) in Xcocde and select Get Info...

    Sorry for the typo.

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

    I had the same issue. try to

    • clean
    • build and run

    it worked with me

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

    I got this problem when I accidentally added another Image set to Asset Catalog file. I renamed it after I realised the mistake, but it doesn't seem to work.

    Removing the file and adding it again solves the problem.

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

    Maybe after you set the button's image, you changed the image's name.

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

    In my case, it was because Photoshop wasn't saving my files correctly. In the file save dialog I was clicking on myfile.png in an attempt to overwrite that file, and it was saving the file with a png extension, but in photoshop format.

    I had to make sure to actually change the file format to PNG before clicking on the file I wanted to overwrite, thus saving in actual png file, thus being readable by iOS. Interestingly, interface builder showed my psd-as-png files just fine.

    More generically, make sure your file is, in fact, in the format you think it is and that iOS is therefore expecting.

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

    Check to make sure that canary04.png exists in your project, and that it was not deleted.

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