【发布时间】:2017-11-19 10:46:27
【问题描述】:
我处理了一些照片,完成后,我调用以下函数来显示输出 UI。我需要确保当前的捕获视图控制器被解除并且不希望它在后台运行。我使用的功能是这样的:
-(void)openOutputUIWithImage:(UIImage*)displayImage{ //update UI with new viewcontroller with specified image to display
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
outputView = [mainStoryboard instantiateViewControllerWithIdentifier:@"OutputView"];
outputView.img = displayImage;
[self dismissViewControllerAnimated:NO completion:^{
[self presentViewController:outputView animated:YES completion:^{
NSLog(@"output view opened!");
}];
}];
}
但我收到以下错误:
Warning: Attempt to present <OutputViewController: 0x100858af0> on <CircleDetectionViewController: 0x100857c20> whose view is not in the window hierarchy!
我真的不确定我做错了什么,我没有太多使用多个视图控制器的经验。它似乎在我的另一个视图控制器中点击了我的 viewDidLoad 方法,但只显示了一个空白屏幕。任何帮助将非常感激!提前致谢!
【问题讨论】:
标签: ios objective-c uiviewcontroller uistoryboard