简体   繁体   English

将Segue从ViewController推送到TableViewController不起作用

[英]Push segue from ViewController to a TableViewController not working

I have a normal ViewController which i have added a button to make a push segue to a table view controller. 我有一个普通的ViewController,我已经添加了一个按钮来对表视图控制器进行推送。 I have a tab bar in my application and i need to keep it in all views. 我的应用程序中有一个标签栏,我需要将其保留在所有视图中。 But when i make the segue while running the app i get the following error. 但是,当我在运行应用程序时进行搜索时,出现以下错误。

SGenericException Reason: Could not find a navigation controller for segue 'View'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.

I have searched and found that i have to embed in navigation controller and i did. 我已经搜索过,发现我必须嵌入导航控制器中并且确实做到了。 But i still get that error. 但是我仍然得到那个错误。 Thank you. 谢谢。

Solved. 解决了。 Jassi you were right. 贾西,你说得对。 I had just to add in the first view controller a navigationController. 我只需要在第一个视图控制器中添加一个navigationController。 And that was just what i did. 那就是我所做的。 I embed in my firstviewcontroller a navigationcontroller and just did the push segue. 我在我的firstviewcontroller中嵌入了一个导航控制器,然后进行了推送。 I didn't embed a navigation controller in the view that has the tableview. 我没有在具有tableview的视图中嵌入导航控制器。 Thank you for your replies. 谢谢您的回复。

Not really enough information to go on, have you tried popover instead of push? 没有足够的信息继续下去,您是否尝试过弹出窗口而不是推送? You need a navigationController to 'push' a view 您需要一个NavigationController来“推送”视图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM