解析在iPhone模拟器上未更新的PFUser数据

时间:2017-05-03 01:06:33

标签: ios swift xcode parse-platform parse-server

由于某些原因,在模拟器上测试我的应用时,用户数据永远不会更新。例如,对象的值" age"可以更改为22,但模拟器的行为就像它仍然是21.有人会知道它是否只是一个模拟器问题,并且在手机上运行方式不同?我的iPhone屏幕完全坏了,所以我现在无法测试它。

1 个答案:

答案 0 :(得分:0)

在Parse中,PFUserPFObject的子类,要更新PFObject中的Parse iOS SDK,您有很多方法可以做到这一点

有两种流行的方法:

例如fetch

guard let myUser = PFUser.current() else { return } // Get the current user
do {
try myUser.fetch()
} catch {
  print("Error when fetching the new data")
}

例如fetchInBackground

guard let myUser = PFUser.current() else { return } // Get the current user
myUser.fetchInBackground()

您还可以使用fetchInBackgroundWithBlock

的闭包
相关问题