UserService.update will crash

Hi,

This is a really urgent problem.
Our app is going to go public pretty soon but the app is constantly crashing.
After some debug and we make some experiment code, here is the code will cause the crash

    Types.tryblock({
        let user = backendless.userService.login("some email", password: "******")
        print("login success")
        user.setProperty("firstName", object: self.randomAlphaNumericString(4))
        let updatedUser = backendless.userService.update(user)
        print("User Updated. firstName: \(updatedUser.getProperty("firstName") as! String)")
        }, catchblock: {
            (exception) -> Void in
            print("Server error: \(exception)")
    })

func randomAlphaNumericString(length: Int) -> String {

    let allowedChars = "0123456789"
    let allowedCharsCount = UInt32(allowedChars.characters.count)
    var randomString = ""
    
    for _ in (0..<length) {
        let randomNum = Int(arc4random_uniform(allowedCharsCount))
        let newCharacter = allowedChars[allowedChars.startIndex.advancedBy(randomNum)]
        randomString += String(newCharacter)
    }
    
    return randomString
}

We provide a random string generator function for easy testing. Basically, the app will crash after this piece of block run for several times in a row(Use a for loop for 100 times e.g). The exception we catch is

Server error: *** -[NSDictionary objectForKey:]: method only defined for abstract class. Define -[NSMutableDictionary objectForKey:]!

Notice that this is a sync call, and we should use async call that will crash the app with the above error. We think this is sth wrong with the UserService implementation. We appreciate if you could offer some help and investigate into this issue.

Thank you in advance

Hi!
I tried your code and it works correctly with my app.
Could you try the same steps with latest version of sdk: https://github.com/Backendless/ios-SDK ?

Hi Kate,Yeah, we are using the latest version of SDK.

Have you tried running it for several times?
Can you try running this piece of code for like 100 times, the bug does not always get triggered.
If the bug does not happen, try running this again in the same running instance (e.g, have a button and register
a clicking event for running this)
We make a fake testing program that has a button associated with it, once you click this, it will call this piece of
code. Feel free to use it if you find it hard to reproduce it. (Try clicking the button for a lot of times.)
For the testing program, we only create a new project and pod install the IOS-SDK. So, there shouldn’t be any other issues inside the code.

We are really sorry about the inconvenience that brought to you, let me know if you still can’t reproduce this.
(If need our APP_ID and secret key for testing, let us know.)

created internal ticket BKNDLSS-12490

We’ve found the solution - please update Backendless SDK from CocoaPods (3.0.17 release) or from github (CommLibiOS and backendless).