不支持推送导航控制器错误消息 [英] Pushing a navigation controller is not supported error message
问题描述
我正在开发一个应用程序,用户可以在其中添加产品,然后这些产品会显示在 TableView 中.我创建了一个带有静态单元格和两个部分的 TableViewController,我想将第二部分中的单元格与另一个 TableViewController 挂钩.
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.
我从对象库中拖动了 TableViewController,将其嵌入到导航控制器中,并从单元格到 NavigationController 进行了推送,但是当我尝试运行应用程序时,我在输出窗口中收到以下错误消息:
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:
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:终止调用抛出异常
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
这是我的故事板的屏幕截图.
非常感谢!
花岗岩
推荐答案
你的 UINavigationController
在错误的地方.它应该在 UITableViewController
之前.
Your UINavigationController
is at the wrong place. It should be before the UITableViewController
.
您可以从故事板中选择 UITableViewController
,然后从菜单中选择:Editor > Embed In > Navigation Controller.
You can select the UITableViewController
from story board then from menu: Editor > Embed In > Navigation Controller.
您可以从参考指南中获取有关导航堆栈的更多信息.
You can get more info about the navigation stack from the reference guide.
这篇关于不支持推送导航控制器错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!