Xcode runtime error Could not load the "_IBBrokenImage_" - ios

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!

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

Black screen on app launch after latest Xcode 7.2 update

i am making a very complicated app with a lot of classes.
my app worked great and i worked on it for the last month.
the last time i worked on it i added a function and it worked great, i saved the app and ran it a few times since and it worked. the last time i turned my computer on, it prompted me that an update for xcode is available. i updated it, and since then every time i run my app it runs with no errors but on ios simulator it shows a black screen. what can i do? i worked really hard on that app. thanks for the help in advance.
There's few issues that could happened, withou detailed description of this issue, you can try following solutions:
reset simulator
check if your initial controller is set up in storyboard(select controller and press attribute inspector, select is initial view controller):
if you're setting initial view controller programmatically, check if that controller is not nil in app delegate
another tip - try to use UI debugger, that helps a lot:
Any debug messages in the Xcode output? That usually will give a clue.
One thing I can think of, is that in your
- (void) applicationDidFinishLaunching:(UIApplication*)application
delegate, try setting the window's root view controller to your view controller. Example:
[window setRootViewController:viewController];
[window makeKeyAndVisible];
Again, the Xcode debug output will confirm if this is indeed the case though.

Xcode crash on opening storyboard

I am developing an app for iOS with Xamarin. Lately, I haven't been able to access my storyboard file in Xcode or compile my app anymore because Xcode crashes right away when opening the .storyboard file.
The error message is the following:
ASSERTION FAILURE <br>
Details: Creating an out of band arbitration unit with a view (<IBUITableViewCell: 0x7fa88d13a5d0>) as the root under another view (<IBUITableView: 0x7fa88cf000e0>) is not yet implemented.<br>The view would need to be in two arbitration units, the one above for positioning constraints, and the root of the one below for sizing constraints. <br>But then that means that subviews cannot have constraints that affect the size of the view, so the view must have ibExternalTranslatesAutoresizingMaskIntoConstraints set to YES.
<br>Object: <IBUITableViewCell: 0x7fa88d13a5d0>
<br>Method: -ibArbitrationUnitWasCreatedWithReceiverAsRootUnderParent:
I tried rebasing my storyboard to the last version that worked (the one the app was submitted to the app store) and weirdly, even that version didn't work.
My plan was to manually remove and every view controller and add them one by one to figure out where the error is.
However I don't understand why XCode crashes when opening the storyboard and not just shows me exactly where the error in my xml is.
So if anyone has encountered this problem before and has a better way to fix it than to manually do it, I would really appreciate any help.
ibExternalTranslatesAutoresizingMaskIntoConstraints needs to be YES
Sounds like the Storyboard was created with an older Xamarin.iOS that introduce this issue.
The fastest solution is to open the storyboard in vi (or Xcode / View As Source, or another text editor of your choice, and replace all translatesAutoresizingMaskIntoConstraints="NO" with "".
Save the file, re-open it in the Storyboard editor and fix your contraints.

iOS 9 Segue Causes App To Freeze (no crash or error thrown)

I have been working on this app for months now and from as far back as I can remember I have never had an issue with segues. The code is unchanged in terms of calling performSegueWithIdentifier but since my recent update to Xcode 7 and iOS 9 I have not been able to tack this issue.
I have tried:
Deleting button and creating new button w/ segue link
Using a direct segue from button to view, without the use of performSegueWithIdentifier
Connecting button to new blank viewController
When I press the button, no initial load functions are called on the destination VC (Ex: ViewDidLoad, ViewWillAppear, etc). When I connect it to a blank view, the segue works fine with the same code in place.
Since the code never stops, or breaks, and just seems to "freeze" in place while still running on Xcode I can't seem to even narrow this down to whats causing the issue. I have a similar segue that is also called from another button on the same ViewController that has no issues whatsoever.
Any thoughts on the matter are greatly appreciated!
EDIT: I have narrowed the issue down to the UITextView's causing the problem. Once the Text Views were removed the page loads fine via segue. I wonder what changed between iOS 8 and iOS 9 in terms of UITextView as I will have to remove the text views and completely re add new text views.
So basically the segue was freezing because of the UITextView's I was using in the destinationViewController. The following fixed the issue:
Delete all UITextView's
Add new UITextView's
you must leave the default lorem imposed text and change this programmatically in the viewDidLoad()
This was the fix for me, and from the research I have done on the issue it seems this is a bug in iOS 9 and Xcode 7.
Cheers!
NOTE: Removing the text in the UITextView (or making it longer then ~12 characters) is sufficient to work around it, no need to delete and recreate them. This is fixed in Xcode 7.1.1 and later.
I ran into the same issue and the fixes in this post (Xcode 7 crash: [NSLocalizableString length] 30000) solved the issue for me.
The first is to enable a localisation other than the base for the storyboard (see https://stackoverflow.com/a/32688815/3718974)
The second is to turn off the base localisation (see https://stackoverflow.com/a/32719247/3718974)
I think I have the same problem: I have a UITabelView with cells created from a nib file, when a user tap a cell this method is called:
and when I have the following method prepareForSegue:: the application crashes:
if I delete the line 129 Everything is ok , the method prepareForSegue:: open the right view and the label contactName is shown with its default text.
If I modify the method as follows prepareForSegue:: get exactly what you expect, without having any type of error:
let me know if you also get the same result
Any one who is facing this issue, i solved it by turning off the "Optimize rendering for windows scale" option in Debug of simulator window. I already had tried all of the above answers but could not solve the issue.
In the method in the first viewController where you activate the segue, do you have beginIgnoringInteractionEvents anywhere? If so the screen you segue to will be frozen and will ignore interaction events like you describe. If this is the case you can fix this by adding an endIgnoringInteractionEvents method before your segue method:
UIApplication.sharedApplication().endIgnoringInteractionEvents()
self.performSegueWithIdentifier("editItemToMyGearSegue", sender: self)
I realize this is an old topic, but appears to be still relevant. I was facing the same problem in Xcode 9, iOS11. My UITextViews are embedded inside UITableViewCells. Same symptoms as described here. The tricks with default text and placeholders did nothing for me, but I solved it by turning off the scrolling indicators for the text view in the xib. They were on by default, I guess, though unused.
Edit: this is probably an important detail... the views that were hanging all had an image NSTextAttachment in the attributed string of the text view. I think the image was wider than the available table cell content. With scrolling turned off, they appear to downscale.

Weird animations when changing NavigationItem prompt

I have these ViewControllers added in storyboard:
None is connected with a custom class, everything is from pure storyboard.
Video on iPhone simulator on iOS7
This only happens when using AutoLayout on iOS7.
Anyone else seen this?
Download sample project of problem
I think this problem occurs when view is getting autolayout and setting it size to main screen size. In iOS 7 navigation push animation come before view size is set so we can see that animating. Don't worry it works well in iOS 8.0 and later. For iOS 7.0 you can give size of view in viewDidLoad so it can adjust size before it appears.
Edit 2:
As someone mentionned in the comments, I am unable to reproduce the problem with your sample project. One thing I noticed though, is that your project is configured with a deployment target that is iOS 8.3. Here are the steps to fix that :
Step 1: Select your project in Xcode's Project Navigator.
Step 2: Make sure you select your project in the left column of the project editor and not the target
Step 3: Select the Build Settings tab
Step 4: Modify the iOS Deployment Target to iOS 7.1 or iOS 7.0 depending on which OS you are testing with.
Step 5: Build and run.
Hopefully this will help you out.
Edit:
Step1. Select your UIViewController with the label 14 and in the third tab of the right pane of Xcode, enter a Storyboard ID such as vc14.
Step2. Select your UIViewController with the label 12 and in the same tab, enter a custom class such as ViewController.
Step3. Remove the trigger segue action from your Button and replace it by a #IBAction in ViewController
Step4. Add this code to your #IBAction in ViewController :
#IBAction func push(sender: AnyObject) {
var vc14 = self.storyboard?.instantiateViewControllerWithIdentifier("vc14") as! UIViewController
vc14.view.layoutIfNeeded()
self.navigationController?.pushViewController(vc14, animated: true)
}
Explanation:
The weird animation is occurring because layout has never occurred before the segue pushes the UIViewController in the UINavigationController. iOS 7 didn't protect appropriately against such a scenario by manually calling layoutIfNeeded before entering an animation block and when the layout finally occurs, it triggers implicit animations. In the code sample I have given you, I manually trigger layout before pushing the ViewController on the stack in order to avoid this issue.
i think you Press ⌘T. so the Slow animation is start. Check the all Simulator you Use.
Debug->Slow Animation
I attach Image check it.

Storyboard crashes Xcode when opened

Whenever I attempt to open up my storyboard, Xcode crashes with the following error report
The funny thing is, the app works fine in the simulator and builds without errors. What is causing this crash? I see two possible crashes:
Exception reason: UITableView dataSource is not set
, but that shouldn't make the storyboard crash right?
Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.
Which doesn't give much information at all.
I have been using a storyboard with Xcode 5 for some time, so the question does not appear to be related to moving from Xcode 4 to 5. I can open the storyboard as XML and I can open my iPhone storyboard just fine.
If you are using git, I would recommend reverting to a time before this problem started.
If you are not using git, and you are absolutely sure you did not edit the xml for the storyboard then I would say:
1)find the storyboard file using the finder.
2)copy it to your desktop.
3)go back to Xcode and delete the storyboard from your project, select "move to trash". 4)re-import the storyboard file into your project.
Ive had similar problems with Xcode 5 and either reverting using git or the steps above usually get me back up and running.
Exception reason: UITableView dataSource is not set
Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.
The errors described above lead me to think that one if not all viewcontroller(s) for the items listed above lost their connectivity to viewcontroller.h / viewcontroller.m files. I would make sure you have everything wired up correctly, and you can check this by making sure the items in your viewcontroller have a circle in the gutter (next to the line numbers) that is filled in (solid) if the circle is not filled in then it means your items are not wired up to your viewcontroller. I would post a picture of your .h / .m file of your viewcontroller so we can further investigate.
I ended up copying each view controller scene (in XML) into a new storyboard. Some view controllers could not be copied without the storyboard crashing so I had to recreate about 4 of them, but by and large I got the majority of my work back.
What you need to do is reopen the project again in Xcode 5 and then go to the storyboard. Then at the right side choose for "Identity and type" and then set "opens in" to Xcode 4.6 to be able to open it in Xcode 4.6. And disable auto layout, somehow when you open it in xcode 5 it asks you to update it, I think you did that without a thought, happened to me as well :)

Resources