ios - Pop To RootView Controller issue -


I have in my project some scene controller or the navigation controller I

UIViewController1, UIViewController2, UIViewController3, UIViewController4, UIViewController5 consider UIViewControllerl is your root view controller and navigation controller. After clicking Navigation, click on the UIViewContoller5 button, I have to return to my UIViewController1 . So I am writing the following code.

  - (zero) popoutup controller unlimited {nslog (@ "% @", [self-navigation controller view controller]); [Self. Navigation controller popToRootViewController is approximate: no]; }  

In the console it prints like

  ( "& LT; UIViewController1: 0x8e3fcc0 & gt;" "& LT; UIViewController2: 0x9a5d310 & gt; "" & LT; UIViewController3: 0x9a67b00 & gt; "" & LT; UIViewController4: 0x9162a00 & gt; "" & LT; UIViewController5: 0x9a84380 & gt; ")  

but it finishes execution After doing my thoughts remains in UIViewController3 . If I print [self.navigationController viewControllers] my in UIViewController3 It seems like,

  ( "; UIViewController1 & lt: 0x8e3fcc0 & Gt; "Finds," & lt; UIViewController3: 0x9a67b00 ";),  

What I'm missing Thanks in advance. Any help would be appreciated.

Try this:

  UIViewController * firstVc = [viewControllers objectAtIndex : 0]; [NavCtrl Setview Controllers: @ [First Wired] Animated: No];  

Comments