Strange behaviour on segue

Hi all,

I yesterday I updated XCode to 7GM.

I opened my current working project and it asked me to convert to new Swift 2.0 syntax so I did it. It gave me a lot of syntax errors, but all errors were easy to fix.

After about 1 hour of error fixing I tried to run app on a device and all was ok...well...all but one thing.

I have a segue (Modally - Cover vertical, not custom) from UIViewController A to UIViewController B. This segue is of course triggered by a "performSegueWithIdentifier" and a "prepareForSegue".

The problem is on showing UIViewController B: it never appears causing app to "freeze" (it is not frozen, process is still alive, but it seems it thinks UIViewController B is shown but it is not).

I debugged it and I found that UIViewController B is created (variables and constants class are ok), but it NEVER reaches viewDidLoad or viewWillApper or viewDidAppear and I don't know why. I have a lot of other similar segues in my app and they work flawlessly.

It worked without problems until conversion to 2.0 so I think it something related to it but..there are no errors at all. It simply does not appears on the screen causing app to be completely stuck.

Any ideas about it?



PS: I tried to connect same segue to another freshly created UIViewController and it worked so I think problem is something related to UIViewController B but I have no idea what I have to check...



Thanks



Lorenzo

I'm getting this too but I haven't nailed down exactly what's responsible. In my case the segue works the first time I launch an app but freezes up on subsequent launches. Deleting the app clears it up for one more launch. Some notes:

  • I'm using Objective-C only.
  • I'm using storyboard references.
  • I went through the Storyboards and made sure every view controller and non-relationship segue has an identifier.
Accepted Answer

After hours of headache I found the problem: it was related to an UITextView in UIViewController B. I don't now why but if I delete that control and re-create it..everything works. I think is something related to conversion from Xcode 6 to Xcode 7 project.

Anyway thanks for your suggestion, I will keep it in mind if I will face a problem like yours!

I have the EXACT same issue with XCode 7 that I just updated to on the App Store.


The issue is that for some reason you cannot launch a modal that contains a UITextView that you have manually typed default text into from Storyboard.


In my tests, I can change the font color and background color of the text view but as soon as you try to change the actual text of the text view in storyboard then that renders my modal un-launchable and freezes my app when I try. This is really weird, and it doesn't seem like a swift conversion issue.


I spent HOURS on this, since it would not give any errors at all and only freeze the app.


Just an FYI, I have auto-layout turned off, but I'm not sure if that's related.

Yes it same problem I faced in my app, but I don't think is related to auto-layout because in my app is turned on. It seems related to UITextView...

Oh my god, thank you for posting this. I'm experiencing the same wonky behavior with same set up except I have auto layout on. Did you report this on their bug tool?

I ran the time profiler in Instruments and it sits and spins on [NSLocalizableString length] when trying to transition to a view holding a problem UITextView. I swizzled that method with one that just returns 0 and the hang stops but the UITextField loads with the object ID of the UITextField as its string. Watching the debugger in my swizzled method try to call the original method gives an EXC_BAD_ACCESS. So I took an educated guess and checked the English localizable strings option on in the storyboard file. No more crash – you can even click the option back off and tell Xcode to delete the strings file and things stay resolved.

radar: 22774690

Strange behaviour on segue
 
 
Q