我想知道UINavigationController
和UIViewController
之間的差異,他們都執行選擇器dismissViewControllerAnimated
。 事實是,他們都有效。我這樣做是這樣的:(UINavigationController&UIViewController)的差異執行dismissViewControllerAnimated
代碼:
UIViewController *vc = [UIViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentViewController:nav animated:YES completion:nil];
,並在新的控制器,我這樣做:
// self.navigationController to dismiss
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
// self to dismiss
[self dismissViewControllerAnimated:YES completion:nil];
兩個,他們工作得很好,但我不知道其中的差別?
非常感謝,我學到了很多東西。但我更關心dismissViewControllerAnimated。 – Andy