I have a webview that loads a page which allows the user to upload pictures. When the user chooses the option to "take photo", the app crashes with the following warning.
Warning: Attempt to present <UIImagePickerController: 0x1563d8000>
on <UINavigationController: 0x156b4c400>
whose view is not in the window hierarchy!
Here is the code that is being used to load the webview
WebViewController *webViewController = [[WebViewController alloc] initWithUrlString:urlString];
[viewController showViewControllerFullScreen:webViewController];
- (void)showViewControllerFullScreen:(UIViewController *)viewController {
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self.view.window.rootViewController presentViewController:navigationController animated:YES completion:nil];
}
Why is the UINavigation Controller not part of the window hierarchy when it is being used to present the web view?