【发布时间】:2015-08-13 01:33:58
【问题描述】:
我有一个项目应该更新 Parse.com 上的 PFObject。它在 IOS 模拟器上运行良好,但是当我将它下载到手机上时,Parse 中的输入没有更新。我检查了 Parse 中的 ID 和 ClientKey 是否仍然正确,并且我的代码中没有错误。 有谁知道怎么回事?
【问题讨论】:
标签: ios swift parse-platform pfobject
我有一个项目应该更新 Parse.com 上的 PFObject。它在 IOS 模拟器上运行良好,但是当我将它下载到手机上时,Parse 中的输入没有更新。我检查了 Parse 中的 ID 和 ClientKey 是否仍然正确,并且我的代码中没有错误。 有谁知道怎么回事?
【问题讨论】:
标签: ios swift parse-platform pfobject
当您在应用程序中处理了要保存到 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)
}
}
【讨论】: