我在尝试运行代码时遇到了一个Breakpoint 5.1错误,请记住,这在我的其他应用程序中运行得非常好。
@IBAction func doneTapped(sender: AnyObject) {
let email = emailField.text
if (email?.isEmpty != nil) {
let emailEmpty:UIAlertView = UIAlertView(title: "Please try again", message: "It looks like you forgot to provide us with your email address, try again.", delegate: self, cancelButtonTitle: "Try again")
emailEmpty.show()
} else {
var user = PFUser()
user.email = email
user.signUpInBackgroundWithBlock {
(succeeded: Bool, error: NSError?) -> Void in
if let error = error {
let errorString = error.userInfo["error"] as? NSString
if error.code == 125 {
print("Invalid Email Address")
} else if error.code == 203 {
print("Email is already taken")
}
} else {
print("Signup Process Completed.")
}
}
}
}
有人能看出我做错了什么吗?我已经写了大约15次,以确保我没有犯一些愚蠢的错误,但我仍然无法弄清楚为什么它在我运行它时会抛出这个错误。