我有一个包含10个布尔值的布尔数组。我想将此数组保存到Parse.com
Parse.com上有一个例子,但是当我尝试保存数组时,它似乎不起作用:
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
}
}
答案 0 :(得分:1)
试试这个。
let myBooleanArray = [false,true,false,true,true,false]
let myObject = PFObject(className: "MyObject")
myObject["booleanArrayColumn"] = myBooleanArray
myObject.saveEventually()