如何在iPhone/iPad中解除pushViewController?

use*_*015 9 iphone cocoa-touch objective-c ipad

我需要创建一个按钮来从pushViewController中解除子视图控制器.该操作与顶部导航栏上的左(后)按钮完全相同.

我怎么解雇pushViewController?我应该使用哪种方法?

谢谢.

Jac*_*kin 15

UINavigationControllerpopViewControllerAnimated:方法应该这样做.


小智 7

在我的情况下[self performSegueWithIdentifier:@"showAllContacts"sender:self]; 推送一个新的ViewController,以关闭(解散)我使用的推送的视图控制器:

[self.navigationController popViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)

这是一个自定义按钮,我添加到导航栏!