问题描述
我在 Xcode6、beta 6 左右创建了一个项目(今天升级到 b7).使用 Swift,一直在为 iOS 8 SDK 等开发.
I created a project in Xcode6, beta 6 or so (upgraded to b7 today). Using Swift, been developing for the iOS 8 SDK, etc.
到目前为止,Storyboard 有两个视图控制器,并且在两者之间设置了一个显示"(它不是由按钮直接触发,它由成功登录处理)
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)
一切都很好.然后我尝试在 iOS 7.1 模拟器上运行该应用程序.它在第一个屏幕上消失并显示以下消息:
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'
好吧,鉴于Show"如何被列为Adaptive Segue",并且 Adaptive UI 几乎是 iOS 8 的概念,因此 iOS 7 会出现问题是有道理的.
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.
由于他们基本上说看,这就是我们过去所说的推送",我想我会将 Segue 更改为推送".当然,它已被弃用,但当 iOS 8 接管时我会放弃它.
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
废话,我不想看到一些烦人的警告,但我不确定我是否想放弃 iOS 7 兼容性(尽管这不是不可能的).这不在代码中,所以我无法抑制警告(或者我不知道如何).
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).
如何在 Xcode 6 中制作在 iOS 7 和 8 中都令人满意的 Storyboard Segue?
How can I make a Storyboard Segue that's happy in both iOS 7 and 8 in Xcode 6?
推荐答案
您仍然可以使用适用于 iOS 7 的新 Segue 类型(例如 Show).确保在您的 Storyboard 界面构建器文档中,将Builds for"设置为iOS 7 而不是 iOS8.(对不起,截图已经准备好了,但我没有足够的声誉来发布它)
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)
在 File Inspector
中选择最低的:
这篇关于“无法实例化名为 UIStoryboardShowSegueTemplate 的类";- 我怎样才能让故事板对 iOS 7 和 iOS 8 满意?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!