2016-05-10 9 views
0

におけるパラメータ「送信者の引数がありませんし、私は他に何を入力する。は、私はいつもこのエラーが出るコール

は、あなたたちは何が起こっているか知っていますか分からないのですか?

@IBAction func loginAction(sender: AnyObject) 
{ 
    let email = self.emailTextField.text 
    let password = self.passwordTextField.text 

    if email != "" && password != "" 
    { 
     FIREBASE_REF.authUser(email, password: password, withCompletionBlock: { (error, authData) -> Void in 

      if error == nil 
      { 
       NSUserDefaults.standardUserDefaults().setValue(authData.uid, forKey: "uid") 

       print("Logged in") 
       self.logoutButton.hidden = false 
       self.performSegueWithIdentifier(String, sender: AnyObject?) 
       self.presentViewController(HomeViewController, animated: true, completion: nil) 
      } 
      else 
      { 
       print(error) 
      } 


     }) 
    } 
    else 
    { 
     let alert = UIAlertController(title: "Error", message: "Enter Email and Password", preferredStyle: .Alert) 

     let action = UIAlertAction(title: "OK", style: .Default, handler: nil) 

     alert.addAction(action) 

     self.presentViewController(alert, animated: true, completion: nil) 
    } 
} 

@IBAction func logoutAction(sender: AnyObject) 
{ 
    CURRENT_USER?.unauth() 

    NSUserDefaults.standardUserDefaults().setValue(nil, forKey: "uid") 
    self.logoutButton.hidden = true 
} 
} 

エラーがライン

self.presentViewVontroller(HomeViewController ...

である私はすでにストーリーボードにセグエを作成した。

+0

少なくともperformSegueWithIdentifier'あなた 'でのタイプ自体ではなく、segueのリテラル識別子や 'self'や' nil'などの型のインスタンスや、senderパラメータに必要なものを渡す必要があります。そして、ユーザのデフォルトで 'setValue'を使わないでください。それは 'setObject'です – vadian

+0

コードのどこにsetValueがありますか? –

+0

'logoutAction'で – vadian

答えて

0

をあなたはセグエを作成した場合。まず、 segueを選択してSegueの識別子を設定する

このようにsegueを実行する

self.performSegueWithIdentifier(識別子、送信者:ゼロ)

この行を記述する必要はありません

self.presentViewController(HomeViewControllerは、アニメーション:真、完了:ゼロ)

関連する問題