ios7 - "Could not instantiate class named UIStoryboardShowSegueTemplate"- 如何让 Storyboard对 iOS 7 和 iOS 8 满意?

标签 ios7 storyboard segue ios8 xcode6

我在 Xcode6、beta 6 左右创建了一个项目(今天升级到 b7)。使用 Swift,一直在为 iOS 8 SDK 等开发。

到目前为止,Storyboard 有两个 View Controller ,并且两者之间的 segue 设置为“显示”(它不是由按钮直接触发,而是由成功登录处理)

enter image description here

一切都很时髦。然后我尝试在 iOS 7.1 模拟器上运行该应用程序。它在第一个屏幕上消失并显示以下消息:

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

好吧,看到“Show”如何被列为“Adaptive Segue”,而 Adaptive UI 几乎是一个 iOS 8 概念,iOS 7 会有问题是有道理的。

由于他们基本上说“看,这就是我们过去所说的推送”,我想我会将 Segue 更改为“推送”。当然,它已被弃用,但当 iOS 8 接管时我会放弃它。

除了如果我使用它我会收到警告

enter image description here

废话,我不想看到一些烦人的警告,但我不确定我是否想放弃 iOS 7 兼容性(尽管这不是不可能的)。这不在代码中,所以我无法抑制警告(或者我不知道如何)。

如何在 Xcode 6 中制作在 iOS 7 和 8 中都令人满意的 Storyboard Segue?

最佳答案

您仍然可以为 iOS 7 使用新的 Segue 类型(例如 Show)。确保在您的 Storyboard 界面构建器文档中,将“Builds for”设置为 iOS 7 而不是 iOS8。 (对不起,屏幕截图已准备好,但我没有足够的声誉来发布它)

File Inspector选择最低:
enter image description here

关于ios7 - "Could not instantiate class named UIStoryboardShowSegueTemplate"- 如何让 Storyboard对 iOS 7 和 iOS 8 满意?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25633739/

相关文章:

ios - 将 UItextField 和 UITextView 添加到 UIAlertView

ios - 使用自动布局创建的 UIView 的左右 16 像素边距

swift - 如何在执行 segue 后销毁 View Controller 的实例

ios - 基于从特定 TableView 中分离出来执行特定操作(如设置 UIDatePicker 的日期)

ios - cellForItemAtIndexPath 在强制滚动以使其可见后返回 nil

ios - 蓝牙IOS : connectPeripheral results a didDisconnectPeripheral with null error SOMETIMES

ios - 无法更改 Storyboard 中的 View 大小

wpf - 在以编程方式添加的控件上使用 Storyboard 动画

iphone - Storyboard和 View 转换

javascript - phonegap/backbonejs 应用程序的 ios7 样式