我是IOS新手,提前對不起,如果我問一個愚蠢的問題。殺死查看並返回rootViewController
我使用的UITabBarController和navigationController控制視圖。
在我的最後一個視圖中,當按下按鈕時,我想要一個按鈕,視圖將返回到由MainWindow.xib文件設置的rootViewController,並終止在應用程序背景中運行的任何進程。
這是我在過去的視圖代碼之前,我想回RootViewController的:
-(IBAction)doneButtonPressed:(id)sender{
JourneyIndexViewController *journeyIndexVC = [[JourneyIndexViewController alloc] initWithNibName:@"JourneyIndexViewController" bundle:nil];
[journeyIndexVC setDistanceLabelValue:self.distanceLabelValue];
[self.navigationController pushViewController:journeyIndexVC animated:YES];
[journeyIndexVC release];
[self dismissModalViewControllerAnimated:YES];
}
JourneyIndexViewController的是,我在MainWindow.xib中設置RootViewController的。
非常感謝您的提前支持。
感謝@ tonio.mg,我嘗試過,但它只是回視圖之前。 – 2012-03-01 15:00:31
所以你就像在第三個視圖中,你想回到第一個視圖? – 2012-03-01 15:02:08
是的,我想殺了任何東西,然後回到第一個。 – 2012-03-01 15:04:51