Storyboard Failed to instantiate class called UIStoryboardUnwindSegueTemplate crash

I just finished Apple's storyboard tutorial and launched the app on my iPhone 4 running iOS 5.1.1.

On the simulator, when I click the add button, I get a modal view that slides from the bottom, without crashing. I can enter the data, click "Finish" and show my new entry.

When performing the same action on my iPhone 4, clicking on the add button causes the application to crash, saying:

* Application termination due to the uncaught exception "NSInvalidUnarchiveOperationException", reason: "Could not instantiate a class named UIStoryboardUnwindSegueTemplate '

This seems like a common problem, but the Google results do not match the error I get.

+4
source share
1 answer

on your device, you said you were using ios 5.1.1. The segue scan is part of ios 6 and will not work on ios 5.

In order for ios 5 to reject the modal view controller, you need to use the following method:

[self dismissViewControllerAnimated:YES completion:nil]; 

You should add this to the method in your tutorial where the view is rejected. If you have a button configured to execute segue, delete the segue line by deleting it in the interface builder.

The most common way to call the aforementioned dismissal command is from IBAction. Therefore, to add this, simply add the UIButton to your storyboard and label it β€œdismissal”. If you know how to connect a button to IBAction, do it. If not, you can right-click on the button and drag the connection line into your .m file. He will offer you the name of the method. call it something like dismsisView. He will create a method template. Inside the template, just add the line above.

Hope you can follow this and that makes sense.

Of course, another way to make it work is to upgrade your phone, but I thought you need help with ios5.

Good luck.

+4
source

All Articles