samedi 9 mai 2015

Issues with Alamofire Request in Swift using Xcode 6.3.1

Could someone help this newbie with a question. I have created the following class

import Foundation

class Search {

var firstName: String
var lastName: String
var dob: String


init(firstName: String, lastName: String, dob: String)
{

    self.firstName = firstName
    self.lastName = lastName
    self.dob = dob
}

}

I have then imported Alamofire into my swift project as i want to make a json request to a rest web service.

This is my request

let searchParameters = Search(firstName: "frankie", lastName: "jones",dob: "09-08-1995")

    request(.GET, "http://blahblahblah/get", parameters: searchParameters)
       .response { (request, response, data, error) in
            println(request)
            println(response)
            println(error) 

So why am I getting the following error: Cannot invoke 'response' with an argument list of type ((,,_))->)'??

Any Ideas? Thx

Aucun commentaire:

Enregistrer un commentaire