【问题标题】:PayFort IOS SDK gives crash when initializedPayFort IOS SDK 初始化时崩溃
【发布时间】:2018-03-15 13:30:53
【问题描述】:

我正在尝试在我的 IOS 移动应用程序中实施 PayFort 我在项目中添加了 PayFort FrameWork 和捆绑包。当我初始化 payFort 对象时,它会给我以下崩溃

由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:'-[UITextField setFloatingLabelActiveTextColor:]:无法识别的选择器发送到实例 0x7f81e3413d40'

我正在使用以下代码:

     func  payforCall(){
        let payFort = PayFortController.init(enviroment: KPayFortEnviromentSandBox)
        payFort?.isShowResponsePage = true;
        payFort?.delegate=self
        let request = NSMutableDictionary.init()
        request.setValue("1000", forKey: "amount")
        request.setValue("AUTHORIZATION", forKey: "command")
        request.setValue("USD", forKey: "currency")
        request.setValue("email@domain.com", forKey: "customer_email")
        request.setValue("en", forKey: "language")
        request.setValue("112233682686", forKey: "merchant_reference")
        request.setValue("token" , forKey: "sdk_token")

        payFort?.callPayFort(withRequest: request, currentViewController: self,
                            success: { (requestDic, responeDic) in
                                print("success")
        },
                            canceled: { (requestDic, responeDic) in
                                print("canceled")
        },
                            faild: { (requestDic, responeDic, message) in
                                print("faild")

        })
    }

【问题讨论】:

    标签: ios iphone swift payfort


    【解决方案1】:

    在目标中的其他链接器标志中设置 -ObjC -> 构建设置选项卡

    【讨论】:

    • 您看过问题标签吗?我很确定如果你有场景你还没有给出这种答案。
    • 是的。我遇到了同样的问题。但是我做了这个修改,这个问题错误得到了解决。而不是这个我可以看到: request.setValue("token" , forKey: "sdk_token") 在这个语句中没有设备令牌。
    • 这只是由于缺少某些类。包含 setFloatingLabelActiveTextColor 方法的定义
    • 好的,然后帮我获取沙盒帐户的 sdk_token。我怎样才能得到它?
    【解决方案2】:

    我遇到了同样的问题,我花了几个小时来解决它,然后才意识到我输入了带有小“C”字母的 -objc

    在项目构建设置中 -> Other Linker Flags -> 设置为-ObjC

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-01
      相关资源
      最近更新 更多