来自 Parse 新手的问候:
任务:更新当前用户的属性(在 Parse 的用户表中)。
问题:收到“UserCannotBeAlteredWithoutSessionError”错误。
这是我的代码:
func updateParseUser(newUser:User, sender:UIViewController) {
let currentUser = PFUser.currentUser()
if ((currentUser) == nil) {
return
}
if let location = newUser.location {
currentUser["location"] = location
}
if let phone = newUser.phoneNumber {
currentUser["phone"] = phone
}
currentUser["displayName"] = "Turkey"
PFUser.currentUser().save()
}
结果:
Error: Parse::UserCannotBeAlteredWithoutSessionError (Code: 206, Version: 1.5.0)
我需要创建一个 session 或其他什么吗?
补救措施?
最佳答案
更新您的 SDK。我有完全相同的问题。当我更新到 1.6.0 时,问题自行解决。
关于swift - 无法更新用户: UserCannotBeAlteredWithoutSessionError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29871065/