【问题标题】:Unable to convert value of type '(FIRUser, _) -> ()' to expected argument type for 'FIRAuthResultCallBack' Error无法将类型“(FIRUser,_)->()”的值转换为“FIRAuthResultCallBack”错误的预期参数类型
【发布时间】:2016-12-17 05:44:00
【问题描述】:

我是使用 Swift 3 的初学者 我收到错误消息:无法将 '(FIRUser, _) -> ()' 类型的值转换为 'FIRAuthResultCallBack?' 的预期参数类型?

这是什么错误,我该如何解决?

func handleRegister() {

    guard let email = emailTextfield.text, let password = passwordTextfield.text else{
        print("Invalid Entry to Form")
        return
    }

    FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: {(user: FIRUser, error) in

        if error != nil {
            print(123456)
            return
        }
    })
}

【问题讨论】:

    标签: swift3 xcode8


    【解决方案1】:

    请将您的代码替换为:

    FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: { (user, err) in
           if error != nil 
           {
                print(123456)
                return
           }
    })
    

    【讨论】:

    • 你救了我的命
    猜你喜欢
    • 1970-01-01
    • 2023-02-05
    • 2023-04-04
    • 2016-05-03
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多