Tag: viewwillapar

当使用presentViewController时,viewDidDisappear不会被调用

我有一个UIViewController有这个方法: – (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; NSLog(@"DISAPPEAR"); lastKnownOrientation = [self interfaceOrientation]; } -(void)openSendVC{ SendMsgViewController *vc = [[SendMsgViewController alloc]initWithNibName:@"SendMsgViewController" bundle:nil]; [self.navigationController pushViewController:vc animated:NO]; } 在第二个视图控制器( SendMsgViewController ) viewDidLoad我有以下内容: [self presentViewController:picker animated:YES completion:NULL]; picker是一个UIImageViewPicker 。 问题是,当我调用openSendVC方法openSendVC一个新的控制器,但viewWillDisappear (的第一个viewController)不被调用。