cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cordova-plugin-wkwebview-engine] Zss1990 opened a new issue #152: Attempt to present <UIAlertController: 0x7f8d50193c00> on <UINavigationController: 0x7f8d4f022000> whose view is not in the window hierarchy!
Date Fri, 15 May 2020 07:28:46 GMT

Zss1990 opened a new issue #152:
URL: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/152


   # Bug Report
   报错```Attempt to present <UIAlertController: 0x7f8d50193c00> on <UINavigationController:
0x7f8d4f022000> whose view is not in the window hierarchy!```
   ## Problem
   当我presentViewController出来一个WXBaseViewController时候,进行alert弹框会报错
   报错```Attempt to present <UIAlertController: 0x7f8d50193c00> on <UINavigationController:
0x7f8d4f022000> whose view is not in the window hierarchy!```
   ### What is expected to happen?
   在类CDVWKWebViewUIDelegate中
   ```
       UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
       [rootController presentViewController:alert animated:YES completion:nil];
   ```
   会有问题,
   是否考虑修改为
   ```
       UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
       if ([rootController isKindOfClass:[UINavigationController class]]) {
           rootController = [(UINavigationController *)rootController visibleViewController];
       }
       [rootController presentViewController:alert animated:YES completion:nil];
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message