This code worked fine in Swift 1.1 ... just trying to figure out what's changed in 1.2 to make it incompatible:
@IBAction func load_click(sender: AnyObject) {
var query = PFQuery(className: "myClass")
query.getObjectInBackgroundWithId("MPSVivtvJR", block: { (object:PFObject!, error: NSError) -> Void in
let theName = object["name"] as String
let theAge = object["age"] as Int?
println(theName)
println(theAge)
})
}
It gives me the error: Cannot invoke 'GetObjectInBackgroundWithId' with an argument list of type '(String, block: (PFObject!, NSError) -> Void)
Any ideas? Thanks!
objectshould be an NSArray, not aPFObject!. - mattNSError!with an exclamation mark. - matt