开发者

How can I get to the RootViewController using pushcontroller?

开发者 https://www.devze.com 2023-02-06 18:55 出处:网络
By below code I am moving to RootViewController from firstView. RootVi开发者_StackOverflow中文版ewController *controller = [[RootViewController alloc]

By below code I am moving to RootViewController from firstView.

RootVi开发者_StackOverflow中文版ewController *controller = [[RootViewController alloc] 
                              initWithNibName:@"RootView" bundle:nil];
[self.navigationController popToRootViewControllerAnimated:YES];      
[controller release];

Now, how can I move to RootViewController from the last View using push, but not with pop????? We have to change pop to push? Can anyone help in suggesting the code for this ?????


popToRootViewControllerAnimated will pop to the beginning of the stack.

myRoot -> firstView -> secondView -> thirdView

If you were to use popToRootViewControllerAnimated in thirdView, it will pop to myRoot.

0

精彩评论

暂无评论...
验证码 换一张
取 消