Could not load “my-icon.png” image referenced from a nib (iPhone)

前端 未结 7 768
抹茶落季
抹茶落季 2021-01-06 06:44

I am receiving the following error message:

2011-02-11 14:47:13.815 myProject[13177:207] Could not load the \"icon-troubleshoot.png\" image referenced from a         


        
7条回答
  •  生来不讨喜
    2021-01-06 07:26

    The warning message suggests there is a reference to this png file in your .xib or .nib file(s).

    Now the question is how to find it. Xcode is poor at doing this. Opening every nib file in a text editor like textedit and manual searching is time consuming.

    The best solution I have for such searching tasks is to fire up terminal and use grep command. Go to source folder of your project in terminal then you can run the following in your case:

        grep -i -r --include=*.xib "my-icon.png" ./
    

    This will return all *.xib files where my-icon.png is referenced. Later when you will see those *.xib files in xcode you'll find a '?' sign in place of my-icon.png showing that image is indeed missing as you deleted it. Now you deleted it to replace it with another image. So select '?' mark symbol, open Utilities area (to the right) and choose the correct file name. That is all.

提交回复
热议问题