Backendless Support
 
Answered

unlinking Relations Objects using Dictionary API

Hello,

Im using the following API to update a row ( [backendless.persistenceService save: entity: error: ];

Its working fine when I need to link an Relationship Object with a certain field (using the "___class" Key), however I could not find a way to unlink an existing relationship object .. Please help

Regards

Leave a Comment

Comments (6)

photo
1

Hi, Eyad Pro.

Just try to set "null" value instead of the object reference.

photo
2

Hi Oleg

So in iOS NSDictionary value can't be set to null directly, alternatively it ca be set to [NSNull null]

so the format is [Dict setObject:[NSNull null] forKey:@"relatedObject"]) ...when I do that nothing get updated on backendless and the related object stays as is

photo
1

Hi Eyad

I've added a link of iOS SDK docs below, take a look, maybe it will helped you

https://backendless.com/documentation/data/ios/data_relations_save_update.htm

search by this "Removing one contact from PhoneBook"

Regards, Vlad

photo
1

Hi Vlad,

The method mentioned in the page above is not Dictionary based [backendless.persistenceService save: entity: error: ].. I need the dictionary based because there are other Fields I'm updating at the same API call .. so its not really possible ..

photo
2

Hi Support Team,

Im still waiting for your response here please .. plus the ticket status should be updated

photo
1

Hi Eyad,

Sorry for the delay.

Looks like it's not possible with the Dictionary.

Meanwhile, Backendless 4.0 was release with a new relation management API, which now allows you to do what you want.

photo