Could not load the “” image referenced from a nib in the bundle with identifier

后端 未结 22 2882
渐次进展
渐次进展 2020-12-01 11:32

when I load my application it shows a warning message that

\"Could not load the \"\" image referenced from a nib in the bundle with identifier \"

相关标签:
22条回答
  • 2020-12-01 12:08

    I got the same error message (in XCode 8), even though the app ran fine (in the simulator and on the device).

    I found the problem: In my storyboard, using the document outline pane, I clicked through every single UIImage, and looking at the attributes inspector for each UIImage - in the Image View section - found that one UIImage had a blank file name (instead of the .png file name containing the image). Reselecting the .png file name from the dropdown box fixed the error message.

    0 讨论(0)
  • 2020-12-01 12:08

    My guess is that you have an image in the Project Setting->Build Phases->Copy Bundle Resources which loses its reference and appears in Red text color. Remove this image from there and re-add.

    This happens often due to relocate the image file after adding into project where image was added as a reference instead of a copy.

    May be this can fix your issue.

    0 讨论(0)
  • 2020-12-01 12:09

    This happened to me as well. I was doing everything right when adding the image but for some reason it was not working. I had to click on the image again once added, and then on the right toolbar under "Target Membership" I noticed my project was not selected even though I was selecting it when adding the image. I selected it here and everything worked fine.

    0 讨论(0)
  • 2020-12-01 12:11

    I pulled my hair out over this issue for hours and none of the solutions in this thread worked. The problem, in the end, was that the Xcode project files were stored on a Google Drive file stream. As soon as I moved it to the local drive or iCloud it worked fine.

    0 讨论(0)
  • 2020-12-01 12:11

    Urughhh. I tried to fix this with all the above solutions, but nothing worked. What finally worked was:

    1. Delete image from your project and select Move to Trash
    2. Clean project
    3. Close and restart XCode
    4. Rename your image filename so something other than the previous name
    5. Add new image to your project
    0 讨论(0)
  • 2020-12-01 12:13
    1. Click on the image file in your Xcode navigator.
    2. Once selected, go to the right side bar (of XCODE) which is utilities and under file inspector, scroll to target membership and select your project target file.
    3. Then build and run the project again.
    0 讨论(0)
提交回复
热议问题