我总是收到此错误,而且我不知道还要输入什么。
你们知道这是怎么回事吗?
@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...
我已经在 Storyboard中创建了一个 Segue。
最佳答案
如果您已经创建了 Segue。首先选择segue并设置Segue的标识符。
然后像这样执行segue
self.performSegueWithIdentifier(标识符,发件人:nil)
这一行不用写
self.presentViewController(HomeViewController,动画:true,完成:nil)
关于ios - 调用中参数 'sender' 缺少参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37133770/