Xcode runtime error Could not load the "_IBBrokenImage_"

Viewed 4180

I am working on an app (Xcode 11.4, iOS 13) with several view controllers. While running on simulator or device, when I navigate to a specific VC, the debugger emits a:

"`Could not load the "_IBBrokenImage_" image referenced from a nib in the bundle with identifier ...`" 

This particular VC does not have any images, just text in buttons, labels and a UITable. It does not trigger standard Swift or Exception breakpoints. Is there a specific Method iOS uses to pull image resources that I might try to trap this with? Alternatively, is there a different approach to finding the issue being complained about? Thanks!

5 Answers

This happened to me when I updated to Xcode 11.4. For some reason, my UIBarButtonItem's image was set as Unkown Image in storyboard. I just had to initialize the image again.

Here is the answer (and if is due to buggy IB in Xcode 11.4): Re-examination of the XML of the storyboard file revealed that Xcode had added, on its own, a variation for RC (landscape) orientation. I didn't do it! The variation image was a random string, basically unassigned. Also, the IB frequently complains that it can not compile by XML from time to time. I think a new release of Xcode would be helpful!

VC3 -- click --> VC1 -- programmatically go to --> VC2 I got this error when app is going to another viewcontroller(VC2) too quickly (programmatically - in my case) before the current viewcontroller (VC1) has finished loading all of its images in nib. In my case, the app travels from VC3 to VC1 and from VC1 to VC2 continuously. So I had changed the app to go from VC3 to VC2 directly and the error has gone. I hope this will be applied to a similar situation.

I had this issue on Xcode 13.2.1 when I unselected 'Installed' on a view in XIB. Deleting the view (I no longer needed it) resolved the error for me.

Change the image to another run and see if it shows, then change it back to the previous image.

Related