xcode 不支持推送导航控制器错误消息

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15525661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:46:06  来源:igfitidea点击:

Pushing a navigation controller is not supported error message

xcodeuinavigationcontrolleruitableviewsegue

提问by Granit

I am working on an app where the user has the possibility to add products and those products are then displayed in a TableView. I created a TableViewController with static cells and two sections and I want to hook the cell in the second section with another TableViewController.

我正在开发一个应用程序,用户可以在其中添加产品,然后将这些产品显示在 TableView 中。我创建了一个带有静态单元格和两个部分的 TableViewController,我想将第二部分中的单元格与另一个 TableViewController 挂钩。

I dragged the TableViewController from the object library, embedded it in a navigation controller and made a push segue from the cell to the NavigationController but when I try to run the app I get the following error message in the output window:

我从对象库中拖出 TableViewController,将其嵌入到导航控制器中,并从单元格到 NavigationController 进行了推送segue,但是当我尝试运行该应用程序时,我在输出窗口中收到以下错误消息:

2013-03-20 09:55:32.981 STAM[725:c07] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported' First throw call stack: (0x1d04012 0x11e8e7e 0x22a5b0 0x22a098 0x585da3 0x577ad9 0x577b54 0x1df899 0x1dfb3d 0xbe6e83 0x1cc3376 0x1cc2e06 0x1caaa82 0x1ca9f44 0x1ca9e1b 0x1f3c7e3 0x1f3c668 0x13065c 0x2a6d 0x2995) libc++abi.dylib: terminate called throwing an exception

2013-03-20 09:55:32.981 STAM[725:c07] 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“不支持推送导航控制器” 第一掷调用堆栈:(0x1d04012 0x11e8e7e 0x22a5b0 0x22a098 0x585da3 0x577ad9 0x577b54 0x1df899 0x1dfb3d 0xbe6e83 0x1cc3376 0x1cc2e06 0x1caaa82 0x1ca9f44 0x1ca9e1b 0x1f3c7e3 0x1f3c668 0x13065c 0x2a6d 0x2995)的libc ++ abi.dylib:终止叫做抛出一个异常

Here's a screenshotform my storyboard.

这是我的故事板的屏幕截图

Thank you very much!

非常感谢!

Granit

花岗岩

采纳答案by Desdenova

Your UINavigationControlleris at the wrong place. It should be before the UITableViewController.

UINavigationController在错误的地方。它应该在UITableViewController.

You can select the UITableViewControllerfrom story board then from menu: Editor > Embed In > Navigation Controller.

您可以UITableViewController从故事板中选择,然后从菜单中选择:编辑器 > 嵌入 > 导航控制器。

You can get more info about the navigation stack from the reference guide.

您可以从参考指南中获取有关导航堆栈的更多信息。

http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html

http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html