Are there special rules for autloading user relations?

I have an order object that holds a bunch of information. In particular it includes relations to a car object and a user object. I have autoload selected for both relations in backendless and the entire car object is successfully retrieved but the user object is blank.

I can see the user is related when I look in the database. The object ID is populated in the cell for object relation and when I click on it it takes me to the expected user in the user table. Is there any reason the related car object would autoload successfully but the related user doesn’t? screenshots attached.

BackendlessUser class operates as a dictionary. All the retrieved properties are stored in an internal HashMap:

You will not see specific properties in the debugger because the structure would be different than of the car class.

Did you try retrieving a property from the returned object?

Yes, when I try retrieving a property my app crashes.

I I retrieve my order object which is related to a user, then try to access a property of that user and it crashes. As I highlighted in my screenshot when I view the inspector in XCode there doesn’t seem to be any data in the user object thats in the order.

After getting a the order from the database I run the following code to access my custom property and it crashes

        let user = order!.user!
        userDetails = user.getProperty("userDetails") as! UserDetails

Logs:

2017-03-12 20:37:34.149796 Yeti[584:96117] -[__NSArrayM getProperty:]: unrecognized selector sent to instance 0x170250f80
2017-03-12 20:37:34.152293 Yeti[584:96117] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM getProperty:]: unrecognized selector sent to instance 0x170250f80'
*** First throw call stack:

Thanks, Chris. We’ll try it from our side. What is your app ID? Also, could you confirm you are using the latest build of the library?

Yeah, I’m using 3.0.44 which seems to be the latest build.

App ID: 34FD2DCA-8177-1858-FFE2-6B094A7CB700

Hello, Chris

getProperty() method returns dictionary, I’ve checked and everything works fine (screenshot attached).

let dataStore = backendless?.data.of(Order().ofClass())
let orders = dataStore?.find().data as! [Order]
 
for order in orders {
 let user = order.user
 let userDetails = user?.getProperty("userDetails")
}

Could you please provide your UserDetails class code or try to use mapTableToClass method to convert the dictionary of user properties to class.

Regards

Olga

Hello Chris,

Was the answer above helpful for you?
Is your problem solved?

Regards,
Olga