例如,我有两个课程Player
和Game
,而Game
有一个字段player
,它是指向Player
的指针。正如Parse文档所说,save
是递归的,所以我假设我只保存player
就可以保存game
,就像这样:
let player = PFObject(className: "Player")
player["name"] = ABC
let game = PFObject(className: "Game")
game["player"] = player
game["round"] = 1
game.saveInBackground()
这是真的吗?
好的,现在假设这是真的,那么仅通过保存player
来更改name
' game
呢?像:
let player = game["player"] as! PFObject
player["name"] = BCD
game["round"] = 2
game.saveInBackground()
你能回答这两个问题吗?谢谢。
另一个问题:如果我想获得player["name"]
,在查询includeKey("player")
时是否需要使用game
?