Open ZhangTaoK opened 5 years ago
xcode 报错误警告
which is already presenting...
导致FaceCheckHelper.openPushFaceViewController(obj);调不起来原生人脸识别的页面。
因为: popover中的控制器, 其实是通过窗口的根控制器presenting出来的, 所以要想窗口的根控制器再presenting其他控制器,需要先dismiss掉原来presenting的控制器
解决方案: 在xcode中打开PushFaceViewControllerModule.m
找到以下代码: UINavigationController nav = [[UINavigationController alloc] initWithRootViewController:lvc]; nav.navigationBarHidden = true; AppDelegate app = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [app.window.rootViewController presentViewController:nav animated:YES completion:nil];
修改为以下代码: UINavigationController nav = [[UINavigationController alloc] initWithRootViewController:lvc]; nav.navigationBarHidden = true; AppDelegate app = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [app.window.rootViewController dismissViewControllerAnimated:YES completion:nil]; [app.window.rootViewController presentViewController:nav animated:YES completion:nil];
在presentViewController之前加入dismiss的方法就可以了。
加入代码:[app.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
如果有更好的方法,请留言。
@ZhangTaoK 已将pr建议采纳,合并master。
xcode 报错误警告
which is already presenting...
导致FaceCheckHelper.openPushFaceViewController(obj);调不起来原生人脸识别的页面。
因为: popover中的控制器, 其实是通过窗口的根控制器presenting出来的, 所以要想窗口的根控制器再presenting其他控制器,需要先dismiss掉原来presenting的控制器
解决方案: 在xcode中打开PushFaceViewControllerModule.m
找到以下代码: UINavigationController nav = [[UINavigationController alloc] initWithRootViewController:lvc]; nav.navigationBarHidden = true; AppDelegate app = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [app.window.rootViewController presentViewController:nav animated:YES completion:nil];
修改为以下代码: UINavigationController nav = [[UINavigationController alloc] initWithRootViewController:lvc]; nav.navigationBarHidden = true; AppDelegate app = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [app.window.rootViewController dismissViewControllerAnimated:YES completion:nil]; [app.window.rootViewController presentViewController:nav animated:YES completion:nil];
在presentViewController之前加入dismiss的方法就可以了。
加入代码:[app.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
如果有更好的方法,请留言。