我有一个应该在Parse.com上更新PFObject的项目。它在IOS模拟器上工作正常,但是当我将它下载到手机上时,输入在Parse中没有更新。我检查过Parse的ID和ClientKey是否仍然正确,我的代码中没有错误。 有谁知道发生了什么?
答案 0 :(得分: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)
}
}