I'm trying to put into a variable my PFObject (I'm using Parse):
func retrieveScore() {
var query:PFQuery = PFQuery(className: "Score")
query.findObjectsInBackgroundWithBlock { (objects:[AnyObject]?, error:NSError?) -> Void in
for varScore in objects! {
let scoreExtract:Int? = (varScore as? [PFObject]) as? Int
}
}
}
But it gives to me this error: "Cast from '[PFObject]' to unrelated type 'int' always fails.
How can I extract the object into a variable? I need an array?
thank you.