Kevin
Kevin

Reputation: 17536

App freezes when segue performed from button

I have a button in my storyboard that presents a view controller with a modal segue. Every time this button is pressed, the app freezes (There is no crash and no error message). prepareForSegue is called and all the view controllers that should be there are there in code in prepareForSegue, but they don't appear onscreen. I can modal segue from the same button to another view controller just fine. Any ideas on why this is happening or how to fix it?

Things I have tried:

  1. Deleting button or using a different button
  2. Recreating the segue in IB

Upvotes: 3

Views: 1438

Answers (2)

CMash
CMash

Reputation: 2168

I had a similar issue in iOS 9 that was fixed by not setting any text in UITextViews, in the storyboard, that were in the destination view controller... bizarre but it fixed it!

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

Upvotes: 0

Kevin
Kevin

Reputation: 17536

Finally got Xcode to give me an error message... turns out I had done

if (self == [super init]) {
}

when I should have done

if (self = [super init]) {
}

which caused all sorts of memory problems.

Upvotes: 1

Related Questions