I'm new to networking, Xcode, and Parse, and I was just following a YouTube tutorial but for some reason the code won't run. Here it is.
func CallData(){
var query : PFQuery = PFQuery(className: "QuestionsAndAnswers")
query.getObjectInBackgroundWithId("DZfARcuav8"){
(ObjectHolder : PFObject!, error : NSError!) -> Void in
if (error == nil){
self.Question = ObjectHolder["Question"] as! String
self.Answers = ObjectHolder["Answers"] as! Array
self.Answer = ObjectHoler["Answer"] as! String
if (self.Answers.count > 0 ){
self.QuestionLabel.text = self.Question
self.Button1.setTitle(self.Answers[0], forState: UIControlState.Normal)
self.Button1.setTitle(self.Answers[1], forState: UIControlState.Normal)
self.Button1.setTitle(self.Answers[2], forState: UIControlState.Normal)
self.Button1.setTitle(self.Answers[3], forState: UIControlState.Normal)
}
}
else{
NSlog("There is something wrong")
}
}
}
The error message says
Cannot invoke 'getObjectInBackgroundWithId' with an argument of type '(String, (PFObject!,NSError!) -> Void)