49

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 had the same issue? Here is the full warning:

Could not load the "" image referenced from a nib in the bundle with identifier "com.blah.Blah"

Adi
  • 5,089
  • 6
  • 33
  • 47
BlueVoodoo
  • 3,626
  • 5
  • 29
  • 37
  • 5
    Have you tried opening the nib in a text editor and search for image references on it? – Alejandro Benito-Santos Oct 01 '12 at 11:50
  • Yes, I have if you mean the .xib file. I couldn't see anything wrong there either. – BlueVoodoo Oct 01 '12 at 12:35
  • Go to build phases and check Copy Bundle Resources. – Minkle Garg Oct 01 '12 at 12:44
  • 4
    Try to make Clean in Product menu. – krafter Oct 01 '12 at 12:55
  • @krafter - Yep, tried that too. Didn't change much. We're several developers working on this project and we all get this issue. I also can't see anything missing. – BlueVoodoo Oct 01 '12 at 12:57
  • @MinkleGarg - There are no files called "" in there. All looks good to me. – BlueVoodoo Oct 01 '12 at 12:59
  • Start going back through source control history until you find the change this started in. Check those diffs. – Graham Perks Oct 01 '12 at 13:01
  • Have to deleted all the files from Derived Data folder? – Minkle Garg Oct 01 '12 at 13:09
  • share us the `.xib` file, please. – holex Oct 01 '12 at 13:09
  • SO, I found the revision where it was introduced. I can't say why or how. Replacing the .xib file in the latest revision worked but if I do the slightest change (like changing the capitalization of a text field), the warning shows up again. I am quite lost. I can't share the .xib as this is production code. – BlueVoodoo Oct 01 '12 at 14:09
  • What version of Xcode? Something oddball to try: open the XIB in Xcode and in the Document Versioning section (in the File Inspector) change the Development type to the latest version there is, and re-save. I have some old XIBs still set to Interface Builder. Probably won't have any effect, but it'd be cool if it did. – Graham Perks Oct 01 '12 at 14:57
  • Do you have any controls that ought to have an image that don't? e.g. NSToolbarItem? – Graham Perks Oct 01 '12 at 14:58
  • I am on the latest v 4.5 (release build not the beta). Will check the versioning section. – BlueVoodoo Oct 02 '12 at 11:32

21 Answers21

72

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

Tom
  • 4,612
  • 4
  • 32
  • 43
  • 2
    If you suspect ImageView, search: Image=" and if it's dead reference like Image="12EF12-FFAA....." find it and change in IB from Unknow_image to your image resource – Eugene Pinchuk Jan 15 '16 at 10:44
  • 1
    Works perfectly. search for image=" if using storyboard and check for ambiguos name like "0E39AEA8-7F29-40B2-96B1-63B99047E8D5" rather than name of an asset from ur catalog – Ankit Kumar Gupta Feb 03 '17 at 16:08
  • Helps a lot.... thanks... I fix my error by checking in xib In xib, its showing image but actually image does not assign to that specific button. – Anjali jariwala Aug 17 '18 at 07:03
36

I had the same issue and in my case there was an UIButton with an invalid image reference in the storyboard file. The reference wasn't empty so it was not trivial to spot by just searching for "" in the storyboard file. However, Xcode did show "Unknown image" for the button in the Background field instead of "Default Background Image". In the storyboard file it appeared as

<state key="normal" title="Use" backgroundImage="0E39AEA8-7F29-40B2-96B1-63B99047E8D5">

so perhaps grepping for backgroundImage and looking for non-familiar references will help find the cause.

idmean
  • 14,540
  • 9
  • 54
  • 83
Vesuri
  • 369
  • 3
  • 4
  • Worked for me too. Searched for "image=" in .storyboard and found similar string. – Evgeny Aleksandrov Feb 16 '14 at 17:40
  • Man, you just saved a life. To make the search process faster, search with joker charachers and insert come colons inside a @"" part. – Tamás Sengel Jul 15 '14 at 12:32
  • That did the trick! Just search "image=" and check if any of the results is like Veruri says – jomafer Aug 26 '14 at 13:53
  • After a search among several storyboards and dozens of xibs, Issue solved! Thank you. For those that still have the issue, try to find an empty reference ("") before a basic manual search: `find . -name *.xib -print | xargs grep '\"\"'` – Rémi Belzanti Mar 10 '15 at 15:07
  • for those of you searching with regex, the search is `image="\w{8}-\w{4}-\w{4}-\w{4}-\w{12}"` – Jacksonkr Nov 11 '15 at 17:07
15

I had this warning because of a UITabBarItem. In the attributes inspector for the field "Selected Image" I had a file listed that was also the value for the field "Image". Nevertheless, I received warnings until I made the "Selected Image" field blank.

Michael E
  • 656
  • 2
  • 7
  • 13
12

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"]];
Tommy Devoy
  • 13,441
  • 3
  • 48
  • 75
  • WOW, this worked for me! I've been the last hour breaking my head and it was just the format! Instead of using the JPEG one with code, I simply added a PNG one and it worked instantly. – Alejandro Iván Jul 02 '15 at 14:16
  • Haha exact same thing happened to me. Glad it could be of help! – Tommy Devoy Jul 02 '15 at 14:18
  • Thanks a lot, adding .jpg to file name solved the problem – samir105 Aug 01 '15 at 13:30
  • I reference the image in the storyboard and it works. I just had to append ".jpg" in the image view's Image field. The image shows up as a big "?" in IB but it works when running on the iPhone. Thanks anyway for this fix! – Nickkk Jun 08 '16 at 20:25
8

I came looking for the answer. I searched my entire project and storyboard source code for "" and nowhere could I find it. The clue that the view that is displayed when the error appears is the one you need.

  • Open your xib or storyboard selecting the relevant viewController.

  • On the left click all grey arrows to expand the selection in your view enter image description here

  • look for the UIImageView icon (its the one with the palm tree)

  • select it and open the "Attributes inspector" on the right hand side. enter image description here

  • In the ImageView section at the top in either or both Image and
    Highlighted you will see greyed out "unknown image".

  • Use the drop down menu to change this from "unknown image" and build run

  • voila

RyanTCB
  • 7,400
  • 5
  • 42
  • 62
4

The nib (or ultimately the xib) that is the cause of the warning message is the one that is loaded when the message gets written. You then can look at the controls that use images in the inspector and find one where the image name is "Unknown image". You can then clear this value by setting it to some value and then clearing out the value. Note that with UIButton you'll need to try the four different values of "State Config" (Default, Highlighted, Selected & Disabled) to see where the invalid reference might be hiding.

ThomasW
  • 16,981
  • 4
  • 79
  • 106
3

In my case it was Unknown image in UIBarButtonItem in storyboard.

enter image description here

ChikabuZ
  • 10,031
  • 5
  • 63
  • 86
2

Very simple remove the image that is not displaying from you project and then clean the project by going to Product--> clean then once again put the image into your project and done. this worked for me.

Husrat Mehmood
  • 2,270
  • 1
  • 20
  • 22
  • I clean the project frequently and the image is called "" (as in nothing). In other words, there is nothing to remove in my case. It's been more than 9 months since I asked this question and I still have this. Completely harmless though. – BlueVoodoo Jul 04 '13 at 16:26
2

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.

imaginethepoet
  • 864
  • 6
  • 14
2

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

onmyway133
  • 45,645
  • 31
  • 257
  • 263
1

in my situation, in my xib file,I had ever setup image name for some UIButton and UIImageView ,and delete these image name after sometime, but for unknown reason, these image still apear in the Interface Builder Editer, finally I reset these image name with any image name and delete them again,now problem resolved.

yglixm
  • 121
  • 1
  • 2
1

This worked for me:

1- Quit Xcode

2- Make a copy of your .storyboard for backup.

3- Open your .storyboard in a text editor and delete image nodes and image node attributes with empty references.

delete node like this --> <image name=" " .../>
delete image attributes like this --> <tabBarItem key="tabBarItem" title="untitled" image=" " id="6"/>

4- Save the file
5- Open your project again in Xcode.
6- Run Product->Clean
7- Run your project

Warning should be gone.

Julio Garcia
  • 665
  • 6
  • 17
1

I had a very similiar problem which I eventually found. The line below was causing the problem using the open as source code method mentioned above.

<tabBarItem key="tabBarItem" title="Events" 
            image="319365D1-7058-46CD-8420-18E0EAFB2F29" id="a5a-IF-j9f"/>
Flat Eric
  • 7,971
  • 9
  • 36
  • 45
Rich
  • 11
  • 1
1

I got this error from an undo action, simply dropping the image back onto the view controller solved the problem.

Atb

SonderCode
  • 11
  • 2
1

In my case it was because one of my button images was wrongly added to the Background Image container instead of the Image container (in the Inspector). I found it by going through the entire storyboard hierarchy and checking each image and button setting.

Jim Rota
  • 1,781
  • 2
  • 16
  • 21
1

i also faced same problem because i edited image in photoshop and saved as a psd format make sure you save your edited images in jpg or png format in my case that was the problem hope it helps!!!

Mehul D
  • 140
  • 2
  • 10
1

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.

Sudheesh
  • 483
  • 6
  • 20
0

I got this problem for all of my images after switching one of the label's text to 'attributed' and using one of the 'Fun' fonts. Even though I switch it back to 'plain' I still get the "Could not load..." error - until I re-load and re-reference all of my images again.

sp00ky
  • 151
  • 9
0

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.

enter image description here

Avijit Nagare
  • 8,482
  • 7
  • 39
  • 68
0

Make sure the 'Target Membership' for the 'Assets.xcassets' has been selected.

  1. Click 'Assets.xcassets'
  2. In the 'File inspector', make sure 'Target Membership' selected.
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
everettjf
  • 116
  • 2
  • 8
0

Believe or not, sometimes this happens because some IBOutlet was removed and in the storyboard have the reference to it.

Julian Corrêa
  • 638
  • 12
  • 25