【问题标题】:PFObject not being updated on IOS devicePFObject 未在 IOS 设备上更新
【发布时间】:2015-08-13 01:33:58
【问题描述】:

我有一个项目应该更新 Parse.com 上的 PFObject。它在 IOS 模拟器上运行良好,但是当我将它下载到手机上时,Parse 中的输入没有更新。我检查了 Parse 中的 ID 和 ClientKey 是否仍然正确,并且我的代码中没有错误。 有谁知道怎么回事?

【问题讨论】:

    标签: ios swift parse-platform pfobject


    【解决方案1】:

    当您在应用程序中处理了要保存到 Parse 数据库中的信息后,是否确保使用 .saveInBackgroundWithBlock { (success, error) ... 块在后台保存值?

    例如,

    标准社交媒体应用程序的关注功能将具有以下功能。

        func follow(user: PFUser!, completionHandler:(error: NSError?) -> ())
    {
        // Storing the relation between current user and another user and then saving it in the database under the relationKey "following"
        var relation = PFUser.currentUser().relationForKey("following")
        relation.addObject(user)
        PFUser.currentUser().saveInBackgroundWithBlock { (success, error) -> Void in
    
            // we now have an error option for the signUp function second loop for the user following themself
            completionHandler(error: error)            
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      • 2015-10-22
      • 2019-03-20
      • 1970-01-01
      • 1970-01-01
      • 2019-02-18
      • 1970-01-01
      相关资源
      最近更新 更多