我尝试使用ReportFieldValue
的{{1}}方法,但会抛出此错误:
getObjectInBackgroundWithId
我写了以下代码:
PFObject
任何帮助?
答案 0 :(得分:0)
您必须使用getObjectInBackgroundWithId
和
let query = PFQuery(className: "posts")
query.getObjectInBackgroundWithId("kk") { (objects, error) -> Void in
}
OR
let query = PFQuery(className: "posts")
query.getObjectInBackgroundWithId("kk") { (objects:PFObject?, error:NSError?) -> Void in
}
更改对象
let query = PFQuery(className: "posts")
query.getObjectInBackgroundWithId("kk") { (objects, error) -> Void in
let testObj = objects?.first as! PFObject
testObj.setObject(26, forKey: "pLikes")
testObj.saveInBackgroundWithBlock { (succeeded, error) -> Void in
if succeeded {
println("Object Uploaded")
} else {
println("Error: \(error) \(error!.userInfo!)")
}
}
}