- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在为我的 watch 应用开发用户界面。我有一个 Home Interface Controller,当推送通知到达时,应该会出现第二个 Modal Interface Controller。
我将两个界面 Controller 拖到 Storyboard上。通常,如果 Controller 上有按钮/表格单元格等,则可以通过从按钮拖动到模态 Controller 来创建模态转场。由于我的模态 Controller 不是通过与按钮交互呈现的,而是通过响应推送通知呈现的,因此我决定以编程方式呈现模态 Controller 。 (我似乎找不到在 Storyboard 中没有按钮的情况下创建模态转场的方法。直接从一个 Controller 拖到另一个 Controller 只给我提供了下一页转场的选项,但没有模态转场。)
但是,如果我在代码中执行此操作, Storyboard中将显示一条警告,指出我的模态 Controller 无法访问。从 Storyboard来看,模态 Controller 确实看起来是独立的和分离的,但我在代码中展示它。有没有办法让警告消失?
最佳答案
为了解决这个问题,您需要为特定的 View Controller 提供一个标识符。转到 Attribute Inspector
,在 Identifier
字段中添加一个值。该值用于通过代码访问 View Controller ,因此它应该是唯一的。
关于ios - Apple Watch Storyboard : Unsupported Configuration - Interface Controller is unreachable for a modal controller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30499506/
我是一名优秀的程序员,十分优秀!