ios - PFObject 未在 IOS 设备上更新

标签 ios swift parse-platform pfobject

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

最佳答案

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

例如,

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

    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)            
    }
}

关于ios - PFObject 未在 IOS 设备上更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30542202/

相关文章:

ios - 如何以编程方式在 Pixate 中获取特定的 CSS 值?

android - 如果 Parse 推送已初始化,则 HTTPS 请求的 SSLPeerUnverifiedException

swift - 如何在文档子类中使用带有键的 cocoa 绑定(bind)?

swift - 创建一个包含两个或多个 `target` 的单个 Swift 包

swift - 未调用解析 SignUpViewController signUpViewControllerShouldSignBeginSignUp 委托(delegate)函数

java - Android 解析本地数据存储返回空

ios - ARSession 中用于文本检测的完成处理程序中的帧信息

ios - 如何使用 AVAudioRecorder 在 iPhone 上录制音频?

ios - 如何在 AFNetworking 3 中通过流式传输下载大文件

php - Swift 3 - 从 mySQL 数据库中提取图像