ios - how to overwrite or empty a Parse PFRelation -
i have problem updating existing parse object relation, replace existing relation new list of objects. unfortunately there no removeallobjects in pfrelation.
pfrelation *buddies = [invitation relationforkey:@"buddies"]; // here need remove existing objects in relation // eg: [buddies removeallobjects]; // new invites (pfprofile *buddy in self.selectedbuddies) { [buddies addobject:buddy]; } what correct ways clear objects in relation, or create new relation , replace current one?
thanks!
the way know of this:
pfrelation *buddies = [invitation relationforkey:@"buddies"]; pfquery *query = [buddies query]; nsarray *array = [query findobjects]; for(pfobject *object in array) { [buddies removeobject:object]; } i don't know if you're using pfobjects or pfusers "buddies," may need modify code little.
Comments
Post a Comment