iOS Swift Paypal集成崩溃与NSInvalidArgumentException应用程序试图在目标上呈现一个零模态视图控制器

时间:2017-05-17 12:21:55

标签: ios swift paypal paypal-sandbox

从链接下载源:https://github.com/paypal/PayPal-iOS-SDK

  

payPalConfig.acceptCreditCards = false

如果我设置payPalConfig.acceptCreditCards to true,则应用程序会崩溃并出现以下异常:

  

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <PayPalPaymentViewController: 0x10184ec00 环境:mock languageOrLocale :en-IN

     

当我点击&#34;用卡支付&#34;选项

1 个答案:

答案 0 :(得分:0)

创建Project-Bridging-Header.h file

  

导入“PayPalMobile.h”

     

导入“CardIO.h”

在viewcontroller.h文件中,并在您的班级中添加CardIOPaymentViewControllerDelegate