12

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.

Zachary Khan
  • 536
  • 4
  • 11
  • This issue is resolved in Xcode 7.1.1 and higher. It had do with with the length of the string in the UITextView, and tagged pointers in iOS 9. Deleting `UITextView` objects was never necessary, just make sure the text is either empty or more than ~12 characters long. – Quinn Taylor Nov 10 '15 at 06:41

6 Answers6

29

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.

Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
Zachary Khan
  • 536
  • 4
  • 11
  • 1
    I just ran into this issue as well...where did you find documentation about the bug? – scientiffic Sep 21 '15 at 21:54
  • There wasn't much on this issue, I think there was one other semi-similar post that had led me to find this bug in my own code. I don't recall exactly where I found that source :( – Zachary Khan Sep 21 '15 at 23:23
  • 5
    This is one of the crazier bugs I've ever encountered on iOS :( ... for me, I had my own placeholder in the UITextView's Text attribute. I deleted that placeholder and recompiled to victory. Didn't have to delete the `UITextView` – keno Sep 22 '15 at 05:17
  • Ah, I also had a placeholder. Maybe I could have just deleted the placeholder instead of the entire view – Zachary Khan Sep 22 '15 at 05:26
  • 1
    Thank you Zachary, had the same issue. I was trying to find the problem in my app for 40 hours, I even could not slept. Really were going crazy about this. You saved my next days:) – saner Sep 23 '15 at 14:26
  • 1
    Glad I was able to help! – Zachary Khan Sep 23 '15 at 17:10
  • I had the same thing as @keno. Changing my default text in the textview to blank fixed the issue. Really weird and random – valheru Oct 06 '15 at 21:19
  • Thanks! Appreciate your effort... Def a bug, came across with it last week, just fixed it today... – JDDelgado Oct 15 '15 at 01:29
  • 2
    This seems like a really big bug – is there any other way to resolve? – scientiffic Oct 22 '15 at 18:48
  • Thanks for this, I just ran into the same problem, didn't even occur to me that it would be a problem with a standard view component. – mire Nov 05 '15 at 21:18
  • @MikeRentas yeah tell me about it. I was pretty bummed when I found out it what the issue was. Glad I could help. – Zachary Khan Nov 06 '15 at 01:21
  • I m also facing this issue... but in my case i dont have any TextView on destination VC .I cleared all UILabel Text which were in the VC but that didnt helped? I have been searching for solution since 3 days still no solution – samridhgupta Jan 04 '17 at 12:48
0

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)

Community
  • 1
  • 1
Iain McManus
  • 1,095
  • 13
  • 21
0

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:

enter image description here

and when I have the following method prepareForSegue:: the application crashes: enter image description here

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:

enter image description here

let me know if you also get the same result

emacos
  • 541
  • 1
  • 8
  • 17
0

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.

Zeeshan Khan
  • 28
  • 2
  • 8
0

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)

James Hubert
  • 300
  • 3
  • 15
0

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.

dlw
  • 511
  • 5
  • 10