What is wrong with this code? I am trying to retrieve data from my SQL database.
import Foundation
class Service {
var settings:Settings!
init(){
self.settings = Settings()
}
func getContacts (callback:(NSDictionary)-> ()){
request(settings.viewContacts, callback: callback)
}
func request(url: String , callback:(NSDictionary) ->()) {
let nsURL = NSURL(string : url)
let task = NSURLSession.sharedSession().dataTaskWithURL(nsURL!){
(data , reponse , error) in
let error: NSError?
var reponse = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers , error) as NSDictionary // extra argument in call , i am having this error.
callback(reponse)
}
task.resume()
}
}