gpt4 book ai didi

swift - 我收到错误消息 "expected ' )' in expression list"连接到@IBAction func createaccountButton

转载 作者:搜寻专家 更新时间:2023-11-01 05:48:41 24 4
gpt4 key购买 nike

    @IBAction func createaccountButton(sender: AnyObject) { !Expected ')' in expression list
FIRAuth.auth()?.createUserWithEmail(emailField.text!, password: passwordField.text!, completion: { (user, error) in
if error == nil {
print("User Created")

if (FIRAuth.auth()?.currentUser) != nil
{
self.myaccountButton.alpha = 1.0
}
else
{
self.myaccountButton.alpha = 0.0
self.welcomeLabel.text = ""
}
}
}
)}
}

我不知道把 ) 放在所说的表达式中请帮助我尝试了一切

最佳答案

对于遇到此问题的人来说,这是因为您的代码中某处缺少一个右括号)。检查您遇到问题的行或之前的行。这是因为有一个左括号(用于参数但没有右括号)来关闭它。确保您的右括号与参数的左括号匹配。

对于这个特定的代码,这是因为你有一个左括号,没有右括号来结束参数:

(emailField.text!, password: passwordField.text!, completion: { (user, error) in 

您缺少上面的右括号。

出于某种原因,您在底部还有一个右括号。

        self.welcomeLabel.text = ""
}
}
}
)} //right here is an obscure closed parenthesis
}

关于swift - 我收到错误消息 "expected ' )' in expression list"连接到@IBAction func createaccountButton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38579623/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com