13

While running my project, I've got this error message.

Could not load the "bs_back_light.png" image referenced from a nib in the bundle with identifier "com.xxxxxxx.new"

I don't use the image file anymore, so I want to delete the image referencing in xib file. However, the project has a lot of xib files, and it is really hard to find xib file which references the image. If it is source file, I would use Find in Workspace(Shift + Command + F), but it doesn't search xib files.

How to search the image referencing from xib(nib) files?

I'm using Xcode Version 4.3.3 (4E3002)

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
Joey
  • 2,912
  • 2
  • 27
  • 32
  • Try to use Finder search on project's directory. – Ilya K. Jul 26 '12 at 09:23
  • check all UIbutton and UIImageView's interface in all xib of application which has image property were u can set imagename which u have to remove which contains bs_back_light.png as image name – Paresh Navadiya Jul 26 '12 at 09:31

4 Answers4

21

I had the same problem and I resolved with some console commands. Open Terminal on your Mac and run this command:

grep -i -r --include=*.xib "bs_back_light.png" /your/project/path

It will search in the path "/your/project/path" and will print the complete path of all files xib that use the image "bs_back_light.png".

Hope this will help you!

Marco Pace
  • 3,820
  • 19
  • 38
3

I wrote a bash function based on Marco's answer so I wouldn't have to refer back to this post all the time. Just throw it in your bash profile, and you'll be able to run it from the command line in your project directory like "grep_xib UIButton", which would search all your *.xib files for instances of "UIButton". Just thought I'd share in case anyone else needed this.

function grep_xib {
    grep -i -r --include=*.xib "$1" .
}
Jacob
  • 926
  • 1
  • 14
  • 25
1

You can use xCode Find in Workspace(Shift + Command + F) now from version 6.x and above, it is now searches xib and storyboard files. See the Interface Builder section in the Xcode 6.0 Release Notes.

Thanks to Anna comment in a similar question

Community
  • 1
  • 1
  • excellent. so we don't need to use the terminal command anymore to search something in xib or storyboard. – Joey Apr 08 '16 at 02:06
0

Look for it in your AppTarget: Build Phases - Compile Sources. If you have found - delete it :)