Pushing a navigation controller is not supported error message

邮差的信 提交于 2020-01-03 18:13:39

问题


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.

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] 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

Here's a screenshot form my storyboard.

Thank you very much!

Granit


回答1:


Your UINavigationController is at the wrong place. It should be before the UITableViewController.

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.

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



来源:https://stackoverflow.com/questions/15525661/pushing-a-navigation-controller-is-not-supported-error-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!