“Could not instantiate class named UIStoryboardSho

2020-02-06 07:20发布

问题:

I created a project in Xcode6, beta 6 or so (upgraded to b7 today). Using Swift, been developing for the iOS 8 SDK, etc.

The Storyboard, so far, has two View Controllers, and a segue between the two set up as "Show" (it's not triggered by a button directly, it's handled by a successful login)

Everything is groovy. And then I tried running the app on the iOS 7.1 simulator. It dies on the first screen with this message:

*** Terminating app due to uncaught exception 
'NSInvalidUnarchiveOperationException', 
reason: 'Could not instantiate class named 
UIStoryboardShowSegueTemplate'

Well, seeing as how "Show" is listed as an "Adaptive Segue", and Adaptive UI is pretty much an iOS 8 concept, it makes sense that iOS 7 would have an issue with it.

Since they've gone so far as to basically say "look, this is what we used to call Push", I figure I'll change the Segue to "Push". Sure, it's deprecated, but I'll just ditch it when iOS 8 takes over.

Except that if I use it I get a warning

Well crap, I don't want to see some annoying warning, but I'm not sure I want to give up iOS 7 compatibility yet (though it's not out of the question). And this isn't in code so I can't suppress the warning (or I don't know how).

How can I make a Storyboard Segue that's happy in both iOS 7 and 8 in Xcode 6?

回答1:

You can still use the new Segue type (such as Show) for iOS 7. Make sure in your Storyboard interface builder document, set the "Builds for" to iOS 7 rather than iOS8. (Sorry the screenshot is prepared but I have no enough reputation to post it)

Inside the File Inspector select the lowest:



回答2:

As i am also getting the same issue with my project. I get this resolved by rechecking all segues i defined in the app. Make sure all segues will have some action like push/pop/modal.

If not then on that controller app will crash. Please check below snapshot which you will find in your storyboard.

your storyboard image will look like first image.

Make cure segue is selected.