Could not load the image referenced from a nib in

2019-03-18 00:37发布

I had got an iPad application.The ViewContrtoller.xib has got an UIImageView in it. The UIImage of the UIImageView is set through Interface Builder. When I run the application in simulator everything is fine. But when I am trying to run it in iPad the UIImage is not loaded. The message that I am getting is:

HexaPuzzle1.0[3259:207] Could not load the "start.png" image referenced from a nib in the bundle with identifier "com.yourcompany.HexaPuzzle1-0" 2010-12-17 10:57:27.221 HexaPuzzle1.0[3259:207] HexaPuzzle loaded

Any help would be appreciated and will be a great help for me.

16条回答
ら.Afraid
2楼-- · 2019-03-18 00:59

This problem was fixed when I changed "add folder reference..." to "add group..." when I import the images to my project. I'd prefer to have folders with live updating, but at least it works now.

查看更多
Evening l夕情丶
3楼-- · 2019-03-18 00:59

Had an image on a XIB (which is replaced by the correct one in code). After finishing this XIB, I renamed the images. So XIB was now referencing a non-existent image.

查看更多
一夜七次
4楼-- · 2019-03-18 01:02

I've had the same problem before. The png file format is not right. Try re-generate the png image file and the problem will be solved.

查看更多
家丑人穷心不美
5楼-- · 2019-03-18 01:03

If you get the error message with the name of the picture, you can search it inside your project and xCode will display immediately the UIImageView with the wrong picture inside UIStoryboard:

enter image description here

查看更多
登录 后发表回答