0
我剛剛開始使用swift中的服務器,並且我正在使用解析服務器來爲用戶創建一個帳戶時存儲用戶數據庫。我有這個功能叫做註冊鏈接到註冊按鈕的正常工作,並妥善保存用戶的信息到我的解析數據庫:從swift中刪除數據庫中的PFUser對象
@IBAction func signUp(_ sender: AnyObject) {
//I first check to see if the users left any of the fields blank
if firstName.text == "" || lastName.text == "" || email.text == "" || userName.text == "" || password.text == "" {
createAlert(title: "Error in form", message: "Please fill in all text fields")
//If everything is filled in
}else{
let user = PFUser()
user.username = userName.text
user["firstname"] = firstName.text
user["lastname"] = lastName.text
user.email = email.text
user.password = password.text
user.signUpInBackground(block: { (success, error) in
if error != nil {
var displayErrorMessage = "Please try again later."
if let errorMessage = (error! as NSError).userInfo["error"] as? String {
displayErrorMessage = errorMessage
}
self.createAlert(title: "Signup error", message: displayErrorMessage)
}else{
print("User signed up")
}
})
}
}
誰能幫我寫一個刪除指定的用戶或多個功能循環遍歷所有用戶並刪除它們。
謝謝
如何將它放入雲代碼中?請問您可以告訴我嗎? – tee