1

I created an relation from PFObject to anotherPFobject ,such as:

[relation addobject:object1];         
[mainObject setobject:relation forkey:@"relate"];         
[mainObject save];         

the "relate" property is an one to many relationship;
Then,if i delete the mainObject

[mainObject delete];         

what i want to konw is that how can i delete the objects the "relate" property related to. Thank in advance.

1 Answer 1

3

You can use an afterDelete cloude code hook to accomplish this, per the guide here: https://parse.com/docs/cloud_code_guide#functions-afterdelete

source: https://www.parse.com/questions/newb-trying-to-cascade-deletes

Sign up to request clarification or add additional context in comments.

2 Comments

@Daij-Djan Does this use up an additional request?
@AlexanderofNorway Yes, it does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.