无法调用非函数类型'String'的值?

时间:2018-06-23 19:11:47

标签: swift

我无法通过电子邮件验证用户身份,因为系统告诉我“无法调用非功能类型'String'的值”。

func handleRegister() {    

        guard let email = emailTextField.text else {return}
        guard let password = passwordTextField.text else {return}
        guard let name = nameTextField.text else {return}

        Auth.auth().createUser(withEmail: email, password: password { (authResult, error) in
            if error != nil
            {return}

            guard let uid = authResult.uid else {return}

            var ref: DatabaseReference!
            ref = Database.database().reference()
            let usersReference = ref.child("users").child(uid)
            let values = ["name": name, "email": email]
            usersReference.updateChildValues(values, withCompletionBlock: { (err, ref) in

                if err != nil
                {return}

                self.dismiss(animated: true, completion: nil)
            })
        })
    }

1 个答案:

答案 0 :(得分:0)

该错误告诉您正在尝试调用String而不是method()。