谁能帮助我并告诉我为什么我在第 2 行出现错误?
消息框还说:
SignIn 致命错误:在展开可选值 (lldb) 时意外发现 nil
@IBAction func done(sender: UIBarButtonItem) {
if isSignIn == false {
//Register code
//Checking for empty boxes
if self.username.text == "" || self.password.text == "" || self.riderDriverSelect.selectedSegmentIndex == -1 {
//Red Border color for missing fields
if self.username.text == "" {
self.username.layer.borderColor = UIColor.redColor().CGColor
self.username.layer.borderWidth = 1.0
}
if self.password.text == "" {
self.password.layer.borderColor = UIColor.redColor().CGColor
self.password.layer.borderWidth = 1.0
}
if self.riderDriverSelect.selectedSegmentIndex == -1 {
self.riderDriverSelect.layer.borderColor = UIColor.redColor().CGColor
self.riderDriverSelect.layer.borderWidth = 1.0
self.showAlert("Missing field required", message: "Fill in or select missing fields in red")
}
}else{