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

扶醉桌前 提交于 2019-12-20 00:55:48

问题


Copy items if needed -> Done Case sensitiveness -> Taken care Image is inside the project folder.

What can be the problem here?

Xcode version 9.0


回答1:


I had the same error , Click on a picture file in Xcode. in attribute, on bottom you'll see Target membership. Check the box and it is gonna work. it worked for me . try it once .




回答2:


I solved it by importing the image into assets (Assets.xcassets) and referencing it from there.

Looks like the build process in Xcode 9 no longer copies the images outside of xcassets into the bundle by default, so simply drag & drop doesn't work

As an alternative, although more cumbersome in my opinion, you could add them manually in the project Build Phases > Copy Bundle Resources




回答3:


Select image in Xcode, then on right side go to File Inspector check the target as follow image:

https://4.bp.blogspot.com/-_Ixa-3TkOR0/Wcn02iGYxJI/AAAAAAAADZE/DaOs9eutj4IH_lOl7DxMtF14btsw8oCpQCEwYBhgL/s1600/Screen%2BShot%2B2017-09-26%2Bat%2B11.55.37%2BAM.png



来源:https://stackoverflow.com/questions/46339785/could-not-load-the-image-referenced-from-a-nib-in-the-bundle-with-identifier

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!