去落格博客阅读完整排版的Could not load the “” image referenced from a nib in the bundle with identifier “com.xxx.xxx”
今天遇到一个奇怪的问题,程序运行一点问题都没有但终端报错如下
Could not load the "" image referenced from a nib in the bundle with identifier "com.xxx.xxx"
其实就是题目上的错误,这个问题看上去挺简单——不就是引用的图片丢失了么……
其实不然,由于名字是
""所以你根本找不到究竟是哪个图片丢失了——实际上一个都没有丢。
毕竟程序里边的资源一个都没有错。
其实,这个问题来自于你的 xib 或者 storyboard,对可疑的 xib 或者 storyboard 点击右键,选择
open as...,以源代码的形式打开,然后搜索关键字“
image”,看看谁的参数里图片的名字是奇怪的随机码,大概如下:
<state key="normal" title="Use" backgroundImage="0E39AEA8-7F29-40B2-96B1-63B99047E8D5">
然后在图形界面去看的话,它图片那里显示的就是“Unkown Image”,把它重新选择一下即可。
然后依次寻找,把所有的错误地方都替换掉,直到这个提示不再出现。
Could not load the “” image referenced from a nib
Could not load the “” image referenced from a nib in the bundle with identifier “com.xxx.xxx”,首发于落格博客。