推导UIViewController没有导航控制器

我正在使用该方法推入另一个UIViewController在条件:

initViewController *MW = [initViewController alloc]; MW = [self.storyboard instantiateViewControllerWithIdentifier:@"init"]; [self.navigationController pushViewController:MW animated:YES]; 

现在我已经改变了我的架构,我刚刚删除了我的导航控制器。 这就是为什么,这些步骤不会再帮助我,因为没有NavigationController存在。 现在我怎么能不按下button – (IBAction)推另一个ViewController。 我只是想在故事板中使用它。

问候。

仅供参考:无UINavigationController您无法推送到另一个控制器。 您可以使用生成一个控制器

PresentViewController

  [self presentViewController:objPortrit animated:YES completion:^{ }]; 

例如:

  initViewController *MW = [initViewController alloc]; MW = [self.storyboard instantiateViewControllerWithIdentifier:@"init"]; [self presentViewController:MW animated:YES completion:^{ }]; 

编辑

 For your comment : 

在使用PresentViewController生成ViewController之后,您需要closures它以生成另一个ViewController。

你可以从他们各自的ViewController使用他的方法来解决这个问题。 :

  -(void)viewDidDisappear { [self dismissModalViewControllerAnimated:YES]; }