Hello, Backendless team
I am trying to retrieve custom user properties but in the object,
I can find some properties inside the object are nil.
Should I run another query for this kind of job?
I thought user.getProperty would return whole object.
here is my code to retrieve array of objects:
func setupPetArray() {
let user = UserManager.currentUser()
if (user != nil) {
let petProfiles = user?.getProperty("petProfiles") as! [PetProfile]
for petProfile in petProfiles {
petArray.append(petProfile)
}
U can find some properties inside the objects are nil.
Thanks in advance.
Yeap, as far as my understanding, when I define the property of the object, I should define the type and property name should be the same with console. And then they can load those properties well. However, in this case, they cannot load some properties. In PetProfile class, they return nil in imagePic, neutralized, weight and vaccination properties. Thanks
Hi KenChoi,
Please check if the properties of Bool and Double are initialised, they must not be optional (?)
I’ve checked your code and everything works fine.
Ok, after I set variables as not optional and initialized, it is working fine. I think these kind of things should be mentioned in the documentation. Thanks for your help ^^