• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

IBAction的错误消息

swift 来源:alex powers 6次浏览
import UIKit 
import Firebase 

class ViewController: UIViewController { 


    @IBOutlet weak var emailField: UITextField! 
    @IBOutlet weak var passwordField: UITextField! 
    @IBOutlet weak var emailkeyboard: UITextField! 
    @IBOutlet weak var passwordkeyboard: UITextField! 
    @IBOutlet weak var myaccountButton: UIButton! 
    @IBOutlet weak var welcomeLabel: UILabel! 


    override func viewDidLoad() { 
     super.viewDidLoad() 
    } 

    override func didReceiveMemoryWarning() { 
     super.didReceiveMemoryWarning() 
     // Dispose of any resources that can be recreated. 
    } 

    //Built in method 
    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { 
     self.view.endEditing(true) 

    } 

    @IBAction func buttonPressed(sender: UIButton) { 
     self.emailkeyboard.resignFirstResponder() 
     self.passwordkeyboard.resignFirstResponder() 
    } 

    @IBAction func myaccountbutton(sender: AnyObject) { 
     FIRAuth.auth()?.signInWithEmail(self.emailField.text!, password: self.passwordField.text!, completion: { (user,error) in 

    } 

    @IBAction func createaccountButton(sender: AnyObject) { 
     FIRAuth.auth()?.createUserWithEmail(emailField.text!, password: passwordField.text!) { (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 = "" 
        } 
       } 
      } 
     } 
    } 
} 

我不知道在哪里把)我以前问过,但我仍然卡住。对不起,请再次提问。 我不知道如果在上面的代码或与IBAction本身的错误,所以我已经发布了所有的代码,也许这将有助于找到问题。IBAction的错误消息


===========解决方案如下:

signInWithEmail()函数调用缺少其结尾圆括号以及闭包参数的实际闭包。


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)