gpt4 book ai didi

ios - 向 subview Controller 添加额外的 UINavigationController

转载 作者:行者123 更新时间:2023-11-29 12:48:43 26 4
gpt4 key购买 nike

我正在开发一个 iPad 应用程序,该应用程序呈现一个从窗口侧面滑出的较小 View 。我需要此 View 独立于应用程序的其余部分运行,并且我需要它拥有自己的导航 Controller ,以便可以在其 TableView 中执行转场。提出这种观点不是问题。我遇到的问题是我无法弄清楚如何将 UINavigationController 设置为拥有这个较小 View 的 Root View 。

我通过使用 addChildViewController: 添加它的 View Controller 作为 subview 来呈现这个 View ,然后将它移动到父 View (呈现 View Controller )。

我在 Storyboard中创建了小 View Controller ,然后通过它的标识符加载 View Controller 。这是 Storyboard的相关部分...

enter image description here

View 加载没有问题,但是当我选择一个依次调用 [self performSegueWithIdentifier:gameIdentifier sender:self]; 的单元格时,我收到以下错误

由于未捕获的异常“NSGenericException”而终止应用程序,原因:“找不到 segue ‘Trivia’的导航 Controller ”。只能在源 Controller 由 UINavigationController 的实例管理时使用推送转场。'

我试过将 View 嵌入 Storyboard的导航 Controller 中,但结果相同。

我很乐意提供任何说明或其他详细信息。非常感谢任何建议!谢谢!

最佳答案

您需要在导航 Controller 中嵌入“Games Award View”,然后在调用 addChildViewController: 时,将导航 Controller 作为参数传递,而不是 Games View 。

关于ios - 向 subview Controller 添加额外的 UINavigationController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22972427/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com