相关疑难解决方法(0)

使用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];  
}
Run Code Online (Sandbox Code Playgroud)

在第二个视图controller(SendMsgViewController)中,viewDidLoad我有以下内容:

[self presentViewController:picker animated:YES completion:NULL];
Run Code Online (Sandbox Code Playgroud)

挑选者是一个UIImageViewPicker.

问题是,当我调用该方法时,openSendVC会打开一个新的控制器,但是viewWillDisappear(第一个viewController)没有被调用.

xcode uiviewcontroller viewwillappear ios

7
推荐指数
1
解决办法
8811
查看次数

标签 统计

ios ×1

uiviewcontroller ×1

viewwillappear ×1

xcode ×1