ios - Apple Watch Storyboard : Unsupported Configuration - Interface Controller is unreachable for a modal controller

标签 ios objective-c uistoryboard apple-watch xcode-storyboard

我正在为我的 watch 应用程序开发 UI。我有一个主界面 Controller ,当推送通知到达时,应该显示第二个模态界面 Controller 。

我将两个界面 Controller 拖到 Storyboard上。通常,如果 Controller 上有按钮/表格单元等,则可以通过从按钮拖动到模态 Controller 来创建模态转场。由于我的模态 Controller 不是通过与按钮交互来呈现的,而是通过响应推送通知来呈现的,因此我决定以编程方式呈现模态 Controller 。 (我似乎找不到一种在 Storyboard中没有按钮的情况下创建模态转场的方法。直接从一个 Controller 拖动到另一个 Controller 只向我提供了下一页转场的选项,但没有模态转场。)

但是,如果我在代码中执行此操作, Storyboard中将显示一条警告,指出我的模态 Controller 无法访问。从 Storyboard来看,模态 Controller 确实看起来是独立且分离的,但我用代码来呈现它。有没有办法让警告消失?

最佳答案

为了解决这个问题,您需要为该特定 View Controller 提供一个标识符。转到属性检查器,在标识符字段中添加一个值。该值用于通过代码访问 View Controller ,因此它应该是唯一的。

enter image description here

关于ios - Apple Watch Storyboard : Unsupported Configuration - Interface Controller is unreachable for a modal controller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30499506/

相关文章:

ios - Storyboard和初始化

ios - 针对不同的屏幕尺寸缩放触摸点

iphone - UIDeviceRGBColor getRed :green:blue:alpha - unrecognized selector, 不是由于内存管理

ios - 选择/取消选择按钮 swift xcode 7

ios - 选择 AnnotationView 两次

iphone - Xcode Allocations Instrument - 监听内存警告

ios5 - 调用 UITextField 委托(delegate)程序时 iPhone 模拟器崩溃(带有 EXC_BAD_ACCESS)

iOS:如何解决大 Storyboard中导航 Controller 场景的问题

ios - 键盘检测

ios - 在 heightForRowAtIndexPath 中调用函数时无限循环