nil
nil

Reputation: 13

parse.com delete object ,by the way,delete the objects it relate to

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.

Upvotes: 1

Views: 239

Answers (1)

Daij-Djan
Daij-Djan

Reputation: 50099

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

Upvotes: 3

Related Questions