Skip to content

Instantly share code, notes, and snippets.

@tranhieutt
Created January 3, 2016 14:38
Show Gist options
  • Save tranhieutt/053cf1f469d36c55d1aa to your computer and use it in GitHub Desktop.
Save tranhieutt/053cf1f469d36c55d1aa to your computer and use it in GitHub Desktop.
Delete object in class of Parse.com
-(void)deleteAccessory:(HondaDataItem *)hondaDataItem withCompletion:(void(^)(BOOL success))completion failure:(void(^)(HondaFailureCode failureCode))failure{
PFObject *hondaItem = [PFObject objectWithClassName:@"HondaItem"];
hondaItem.objectId = hondaDataItem.objectId;
// multi delete
// [PFObject deleteAllInBackground:@[object1, object2, object3]];
[hondaItem deleteInBackgroundWithBlock:^(BOOL succeeded, NSError * _Nullable error) {
if (succeeded) {
// The object has been saved.
completion(succeeded);
} else {
// There was a problem, check error.description
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment