Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 views
in Technique[技术] by (71.8m points)

ios7 - "Could not instantiate class named UIStoryboardShowSegueTemplate" - how can I make a Storyboard happy with iOS 7 and iOS 8?

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)

enter image description here

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

enter image description here

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...