---
title: "ios 中pop跳转，不用再生成一个controller"
author: "BlueSkator"
date: "2014-12-23T15:17:37Z"
tags: ["iOS"]
categories: ["移动开发"]
slug: "ios-pop-controller"
draft: false
lastmod: "2014-12-23T15:17:36Z"
id: 2169541
url: "https://blueskator.iteye.com/blog/2169541"
---

pop跳转：

 

\[self.navigationController popToViewController:\[self.navigationController.viewControllers objectAtIndex:2]   
animated:YES];  
或

for (UIViewController \*temp in self.navigationController.viewControllers) {  
           if (\[temp isKindOfClass:\[你要跳转到的Controller class]]) {  
              \[self.navigationController popToViewController:temp animated:YES];  
           }  
       }