1
我想從Heroku/Parse服務器中刪除username = usernameSelected的行。選擇的用戶名不是零,並且存在於服務器上。沒有什麼看起來是錯的,只有「找不到對象」而不是刪除整行。爲什麼在Heroku/Parse中快速返回錯誤「Object not found」?
let query = PFQuery(className: "Requests")
query.whereKey("username", equalTo: usernameSelected)
query.limit = 1
query.findObjectsInBackgroundWithBlock({ (objects, error) in
if error != nil {
}else {
if let objects = objects {
for obj in objects {
obj.deleteInBackgroundWithBlock({ (success, error) in
activityIndicator.stopAnimating()
UIApplication.sharedApplication().endIgnoringInteractionEvents()
if error != nil {
self.alertDisplay("Error", message: error?.userInfo["error"] as! String)
}else {
self.alertDisplay("", message: "Styles Submitted..! Please wait for your next Style")
}
})
}
}
}
})
哪個程序塊出錯? findObjects ...或deleteInBackground ...?如果第二個,你是否得到了你刪除的所有對象? –
只是一個念頭:你如何在這個類/對象上設置ACL? – toddg
+ Lou Franco:deleteInBackground塊,它在對象確實存在時返回一個錯誤(找不到對象)。 – aijayy