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

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.

Related

Xcode runtime error Could not load the "_IBBrokenImage_"

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.

swift 3.0 folding-cell library table not showing

I am using https://github.com/Ramotion/folding-cell library into my Swift 3.0 projects. It works nice without any editing or changing on storyboard/auto layout changing.
I faced some issues when tried to:
Add few IBOUTLET (in DemoCell.swift)
Add Data to them (in DemoCell's didSet() method)
Now the view is blank. But i can scroll the tableview(it is just not showing), can click and can see folded cell perfectly.
I tried to add constrains as it given in documentation. I get fatal crash.
I am using Xcode 8, swift 3.0. This is happen always even when i download the fresh source code and add new uilabel or anything change on storyboard.
Does anybody tried this library recently ?
Blank Screenshot:
When click in the cell, Other cell is hidden.But clickable.
Foreground view:
It was an issue with the library. Now its solved.
Thread: https://github.com/Ramotion/folding-cell/issues/69#event-819438913

Indentation of UITableViewCell changes after rotation only on iOS 8

I have an UITableView with three dynamic rows. When displaying the UITableViewController the first time everything works fine. After a rotation the rows which have a data in it get an indentation despite I set setLayoutMargins to zero. I cannot reproduce this issue in another project until now. It is only appearing in iOS 8 but but only on one table. The same source for the table is working in a test project without problems. The only difference here is that it is in a container with some other views.
I checked auto layout constraints, the rotation methods, commented things out - all without success. The change of the indentation occurs between willRotateToInterfaceOrientation and didRotateToInterfaceOrientation or after viewWillTransitionToSize. I even updated to iOS 8.1 with the same results.
Has someone expeerienced a similar behavior?
PS:
What I've also noticed that when setting the layout margins to zero on iOS 8 the animation is not as smooth as it would be with the default values (with indentation). On iOS 7 the animation is always smooth.
EDIT:
I tracked some things down. If a UITableViewController is embedded into an UINavigationController the indentation happens on rotation. If you rotate further it goes back to it's set indentation (no indentation in my case).
If the UITableViewController is embedded into a container (and this container is in a navigation controller) than after the rotation the cell get it's default indentation back. If you rotate further this behavior stays the same (always indented).
Are some events not send to the child view controller or none of you uses a UITableViewController embedded into an UINavigationController?
In my opinion it is a iOS 8 Bug or a Xamarin Bug. Perhaps one other could verify if it is the same with his installation. I'm using Xamarin Studio 5.5.2 with Xcode 6.1.
One ugly solution to this is this:
public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation)
{
base.DidRotate (fromInterfaceOrientation);
// otherwise cells are indented! iOS 8 Bug?
TableView.ReloadData ();
}
One could use reloadData or reloadSection in didRotateFromInterfaceOrientation, despite it is a deprecated function. But there is no viewDidTransitionToSize and I also have to support iOS 7.
Edit:
Another solution I have come up with is to draw a custom separator line. This only works for iOS 8 and would answer the question (despite I've another issue on iOS 7 where this approach doesn't help).

UITextField can send its action twice. Is this an iOS bug, or did I make an error?

In iOS, I have a UITextField in a UITableViewController scene that is governed by a Navigation Controller. All static cells. The text field has the "Clear on editing" flag switched on. I want to get and save the value entered in the field, so I have the -editingDidEnd: action call my saveData: method in the custom UITableViewController subclass. If I click out of the text field, all is well. However, if I back out of the scene using the Back navigation button, then saveData: gets called twice. Once with the entered value, and a second time with an empty value. This appears to be incorrect behavior.
I've made a demo project and posted it to GitHub here: https://github.com/davehirsch/BugDemo
Am I doing something wrong? Is this an iOS bug? It seems unlikely that it's a bug nobody else has found (and I've looked around for others reporting similar things). I'm running the latest non-beta versions of Xcode and OS X, and the bug is happening in the iOS Simulator (but I'm not sure if it would happen on a real device, I guess).
Yes you are right. It looks like a bug in UINavigationController.
Before and after animation the method [UITextField resignFirstResponder] is called before and after animation. The first call is done by [UINavigationController popViewControllerAnimated:], and the second one in [UINavigationConteoller navigationTransitionView:didEndTransition:fromView:toView:] that call [UIView(Hierarchy) _removeFirstResponderFromSubtree].
Looks like your text field hasn't resigned yet as a first responder before animation ends.
[EDIT]
I recommend to look at rdelmar comment.

iOS7 UIToolbar crash

I have an iPad app that has been running fine until iOS7. This issue seems to be only on ipad 2nd gen models and earlier when iOS7 is installed. Anyway, I've been tearing my hair out trying to figure out where this error is coming from, but have had no luck. The console in xcode (5) reports the following error after I perform a logged in segue:
2013-11-18 11:17:31.768 MyApp[400:60b] *** -[UIToolbar backdropView:willChangeToGraphicsQuality:]: message sent to deallocated instance 0x18ec23e0
I can't lookup the address for more info (image lookup -a 0x18ec23e0) it just returns nothing.
In instruments running zombies, it reports that a message was sent to a UIToolbar like so:
When I inspect the instance, I get the following:
How do I debug this? I have no idea where this call is being made and it seems dependent upon a physical deivce (doesn't happen on the iPad mini or ipad 3/4)
I was struggling with a very similar error, also with a UIToolbar, that I couldn’t figure out until a couple hours ago. I also had to use and try to understand the zombies’ instrument but without any luck.
What I did was to pay a close attention to the call stack that was presented when the Exception Breakpoint was activated as described in the following tutorial:
http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1
Even though the call stack didn’t point me to the exact code line, I noticed that the app was trying to add a UIToolbar to a ViewController. Turns out that what I was doing was creating a local UIToolbar inside of a method and adding it to the presented UIView. After have modified this behavior, I stopped having the annoying sudden crash. It was difficult for me to find the issue because looking at the code of the ViewController that caused the crash, there was no code that created or used a UIToolbar; however this VC included a custom view that did exactly that, as I explained before.
Have said all of this I recommend you to closely inspect the VC that generates the crash. If you need to create a UIToolbar programmatically I recommend you to declare it as a strong property to maintain the memory reference as long as needed.
I hope this helps you.
I struggled with this for a while today. I had two storyboards, one for login/signup (set as the main storyboard for the project) and another with the rest of the application. The app delegate would detect if a user was logged in and instantiate the root view controller of the other storyboard. The root view controller of the login storyboard is a navigation controller and after after some investigation with instruments I realized there was a UIToolbar being instantiated from the nib. Opening up the storyboard file revealed an off-screen UIToolbar object in the root view controller. I deleted it and I'm not crashing any more.
I should also mention this crash was only occurring when I was using MKMapView.

Resources