Handle Users properties in iOS

Hi. In Users table i have relations (one to one and one to many) to some other tables. How could i retrieve those properties with iOS SDK? In documentation and examples, i see that method getProperty is used to read user properties, but does it work for relationship objects?

Could you also please post an example of how to update user relationships with iOS SDK?

Hi Andres,

You could try the following:

[ backendless.persistenceService findById:@"Users" sid:@"USER-ID-VALUE-HERE" relations:@[ @"YOUR-RELATION-NAME" ] response:^(id user) {
NSLog(@"%@", user);
} error:^(Fault *error) {
NSLog(@"%@", error.detail);
}];

Regards,
Mark

Thanks Mark.

Is there a way to retrieve all user relationships in login?

Andres,

Use the method described here:
http://backendless.com/documentation/users/ios/index.html?ios_retrieve_user_entity_propertie.htm

A relationship property will arrive as:

{
defaultValue = “<null>”;
identity = 0;
name = <property name for the relationship>;
relatedTable = Users;
required = 0;
type = “RELATION_LIST”;
}

Regards,
Mark