如何导航回 Storyboard 上的视图控制器?

How to navigate back to my View controller on the Storyboard?

我已经设置了两个按钮,可以将我导航到 "SecondViewController" 和 "ThirdViewController",但为此我创建了 .XIB 文件。这些工作正常。

我用过:

-(IB Action) clickButton
{
     ThirdViewController *third = [[ThirdViewController alloc]
                                  initWithNibName:nil bundle:nil];
     [self presentViewController:third animated:YES completion:NULL];
 }

同样,这工作正常。我的问题是当我到达我的 "ThirdViewController" 并想要设置一个后退按钮将我带回到我最初的 ViewController 时,它不起作用,因为它在 Main.Storyboard 上,而且它不是 XIB 文件。我如何使这项工作?或者我必须制作一个 XIB 文件并删除 Main.storyboard?

以及如何在没有 NavigationController 的情况下执行此操作,我没有使用它

您应该使用 View 而不是 .XIB 文件。它们已经过时,现在几乎不使用了。对于导航,您可以使用 Seague。为此,您需要在一个视图中创建一个按钮,右键单击该按钮并将其拖放到单击该按钮时要打开的视图。可以使用下一个视图上的后退按钮完成相同的操作。