解析:更改指针的值

时间:2015-11-15 08:02:29

标签: ios swift parse-platform

例如,我有两个课程PlayerGame,而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

0 个答案:

没有答案