swift - 无法更新用户: UserCannotBeAlteredWithoutSessionError

标签 swift parse-platform

来自 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/

相关文章:

ios - Swift Spritekit 接触位掩码和分数标签

swift - 取出后如何将uiview放回stackview?

正则表达式不适用于空字符串 - Swift

parse-platform - 如何确定 ParseObject.save() 有效负载的大小

android - 无法从 Back4App 获取 API22 设备中的图像

ios - Cloud Code 中的 Base64 编码字符串

ios - 为什么 Slides[i].frame 打印的值与 SlideScrollView.subviews[i].frame 不同

ios - 在结构中附加数组 - Swift 2.0

arrays - 如何将 PFFile 数组转换为 UIImage 数组?

ios - 注销之前不会保存当前用户的设置