如果我將視圖推送到Navcontroller上,它效果很好,我可以使用代碼或使用Nav Controller返回按鈕從它返回。dismissModalViewControllerAnimated不返回
然後我改變它以模態呈現視圖。預設的作品,但我不能讓它返回並消除模態視圖。
這工作...主視圖
Tools *screen = [[Tools alloc] initWithNibName:@"Tools" bundle:[NSBundle mainBundle]];
[mainNavController pushViewController:screen animated:YES];
[screen release];
其中一個模式的看法:
- (IBAction)btnCancel:(id)sender {
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:0] animated:YES];
}
但後來我改變它莫代爾這樣的模式的看法不回去主視圖。
Tools *screen = [[Tools alloc] initWithNibName:@"Tools" bundle:[NSBundle mainBundle]];
[mainNavController presentModalViewController:screen animated:YES];
[screen release];
在模式的看法:
- (IBAction)btnCancel:(id)sender {
[self.parentViewController dismissModalViewControllerAnimated:YES];
}
我曾嘗試一切我能想到的,顯然我失去了一些東西!有任何想法嗎?
感謝您的任何幫助!
工作正常!謝謝您的幫助! – 2012-01-19 00:30:16