是否可以在类中创建一行,并且根据某些变量,我在类中创建的字段是否设置为? (基本上使用swift以编程方式创建一行)
答案 0 :(得分:0)
自己解决了,如果其他人想知道这就是代码:
var gameScore = PFObject(className:"GameScore")
gameScore["score"] = 1337
gameScore["playerName"] = "Sean Plott"
gameScore["cheatMode"] = false
gameScore.saveInBackgroundWithBlock {
(success: Bool, error: NSError?) -> Void in
if (success) {
// The object has been saved.
} else {
// There was a problem, check error.description
}
}
的示例