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