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

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -