Backendless Support
 
Solved

User being returned as NSMutableDictionary! Show Stopper!

I'm on 4.0b12 and it looks like the userservice findById method is returned the BackendlessUser as a mutabledictionary. This is causing crashes whenever I try to do getProperty.

Leave a Comment

Comments (6)

photo
1

Are you using it with the Cloud version?

Do you use the dictionary-based or the class-based approach when you make the findById call?

photo
1

Hey Mark :)

Yes I'm using the cloud version.

I believe I'm using the class-based approach, I just need to use the correct responder type right?

  1. BackendlessUser *user = [backendless.userService currentUser];
  2. [backendless.userService findById:user.objectId response:^(BackendlessUser *resultUser){
  3. delegate.user = resultUser;
  4. NSLog(@"user loaded");
  5. }error:^(Fault *fault){
  6. NSLog(@"load user error");
  7. }];

photo
1

Hi Allen!

Yes, this is the class-based approach. Could you also try the following (where YOUR-CLASS would be BackendlessUser):

https://backendless.com/docs/ios/doc.html#data_basic_search

photo
1

Looks like that did it! Finding the user via the datastore apis explicitly using the class-based approach works.

So does that mean the userService apis are defaulting to dictionary based now?

Thanks!

photo
1

We're going to investigate this. It should be returning a strongly-typed object. I will open an internal ticket to check this.

photo
photo
1

Hello Allen,

Please update SDK to the new version 4.0b13. This issue has been fixed.

Regards, Olga