I was using swift 1.2 and everything was going fine. after upgrading my Xcode to 7 . I faced some weird problems.
My code was :
let postData : AnyObject = ["username":username , "password":password] ;
I need this variable to be AnyObject, because
let jsonObject : AnyObject = postData ;
let jsonString = JSONStringify(jsonObject)
let data1 = jsonString.dataUsingEncoding(NSUTF8StringEncoding)
let task1 = NSURLSession.sharedSession().uploadTaskWithRequest(request, fromData: data1) {
(Data, Response, Error) -> Void in
needs a Anyobject for post Data header.
The error is
Value of type '[String : String?]' does not conform to specified type 'AnyObject'
can any one help me?