美文网首页
Application tried to present mod

Application tried to present mod

作者: guoguojianshu | 来源:发表于2021-07-15 10:55 被阅读0次

我遇到的问题,造成的原因,在网络请求的错误code中,进行余额不足时候,跳转充值界面
如果快速点击,这样就造成了多次跳转这个充值界面了

问题修改方法

判断这个充值的控制器时候是否已经出现,和是否正在出现

//    self.presentedViewController;
//    self.XSPurseVC.isBeingPresented;
    NSLog(@"presentedViewController = %@,isBeingPresented = %d",self.presentedViewController,self.XSPurseVC.isBeingPresented);
    if (self.presentedViewController == nil && self.XSPurseVC.isBeingPresented  == NO) {
        NSLog(@"调用次数");
        self.XSPurseVC.XSBalancePurseString = [NSString stringWithFormat:@"%ld",XSGiftPrice - [[XSNewUserModel XSGetCurrentUser].XSMoneyNum integerValue]];
        self.XSPurseVC.XSFromType = 0;
        
        self.XSPurseVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
        [self presentViewController:self.XSPurseVC animated:YES completion:nil];
    }

只有没有控制器出现和控制器没有正在出现时候,才调用控制出现的方法

相关文章

网友评论

      本文标题:Application tried to present mod

      本文链接:https://www.haomeiwen.com/subject/aucspltx.html