Could not load the “” image referenced from a nib

前端 未结 21 2349
广开言路
广开言路 2020-12-23 19:21

I have no images called \"\" (nothing). I\'ve gone through the .xib file of the screen where this pops up and can\'t find anything that would cause this. Anybody who have ha

相关标签:
21条回答
  • 2020-12-23 20:01

    Just for reference, this problem is also caused by using .jpg images and referencing them inside of storyboards/nibs. iOS 8 appears to be able to handle the proper type checking between jpg and png images at runtime. However, on iOS 7 and below you will need to manually set the image in the code and remove the image reference inside of the storyboard to get rid of the warning.

    Remember you need to manually set the .jpg when referencing jpg images.

    [self.imageView setImage:[UIImage imageNamed:@"yourImage.jpg"]];
    
    0 讨论(0)
  • 2020-12-23 20:05

    I'm using Asset Catalog on Xcode 6. Simply removing and re-adding the Asset Catalog fix the problem

    0 讨论(0)
  • 2020-12-23 20:05

    Initially my image name is "bg" When i found issue, i rename image as "background" but when click on image and hit "Show in Finder"changes was not reflected. image was name as "bg-1.jpg".

    so i removed from project convert image to png and drag and drop into project it works for me.

    0 讨论(0)
  • 2020-12-23 20:09

    Please do a search for image= shows various results. Select results from nibs or storyboard open it, if there is some value like image="2342D4DF-1E6B-42B8-847A-F9F622921D02" delete it and enjoy.

    0 讨论(0)
  • 2020-12-23 20:11

    You can do this to check it from your storyboard, or nib. Open it as Source Code:

    enter image description here

    Then "Find" the image name in it, see if it exists but already invalid in your project, probably you have deleted or changed its name, and now it doesn't seem valid.

    enter image description here

    0 讨论(0)
  • 2020-12-23 20:12

    In xcode 5.1 I had this same issue. The only way I could finally get it to work when using storyboard was to add the images as an image asset catalog. From what I read maybe they changed something in 5.1. I thought that storyboards don't have nibs - so it would make sense that asset catalog replaces the old method.

    Project > General > App Icon Arrow > Import New Folder.

    As soon as I did that the NIB references went away and my images showed up.

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