【发布时间】:2020-02-13 04:08:58
【问题描述】:
我正在使用in-app-payments-react-native-plugin 插件将 Square 支付方式集成到 react native 中。在 iOS 中,如果在 Add new card react native popup 上打开卡片输入模型,则会产生问题。我有一个弹出窗口来添加新的信用卡详细信息,并在弹出窗口中调用卡输入模型时从包中收到此警告。如果不是从弹出屏幕调用,它可以在 android 和 iOS 上运行。
Xcode 内部的警告::
Warning: Attempt to present <UINavigationController: 0x7fba6b163400> on <RNNSideMenuController: 0x7fba6b15fa00> which is already presenting <RCTModalHostViewController: 0x7fba6d798340>
我正在使用 Xcode 版本“11.0”并反应原生“0.61.4”。
这个包的objective-c代码产生这个警告::
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
if ([rootViewController isKindOfClass:[UINavigationController class]]) {
[((UINavigationController *)rootViewController) pushViewController:cardEntryForm animated:YES];
} else {
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:cardEntryForm];
[rootViewController presentViewController:navigationController animated:YES completion:nil];
}
这里的 if 部分正在工作,但 if 语句会生成此警告。我是目标 c 的新手。请提出这里发生了什么问题。
【问题讨论】:
-
我遇到了同样的问题,我感觉它与stackoverflow.com/questions/32696615/… 有关,但我也没有 iOS 知识来实现它。
标签: react-native react-native-ios square