debugging - Why does this keep returning error "Object not found" from Heroku/Parse in swift? -
i trying delete row username = usernameselected heroku/parse server. username selected not nil , exist on server. nothing seem wrong @ all, "object not found" instead of deleting whole row.
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 { 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 next style") } }) } } } })
make sure have read , write permissions class
the deleting failing because acl rows created in class have read permission. allow both read , write permissions, in appdelegate under method "didfinishlaunchingwithoptions" see lines
let defaultacl = pfacl();
// if objects private default, remove line. defaultacl.getpublicreadaccess = true
add line --- defaultacl.getpublicwriteaccess = true
this create rows write permissions in future can delete object client side.
Comments
Post a Comment