我有一个项目应该更新 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/