I'm trying to convert this NSData
var elementos = [AnyObject]()
let jsonData = try? NSJSONSerialization.dataWithJSONObject(elementos, options: NSJSONWritingOptions.PrettyPrinted)
the jsonData constant carries this value:
[
{
"id" : "1",
"paid" : false
},
{
"id" : "2",
"paid" : false
}
]
to an array [String: AnyObject] to be able to send it as a parameter in POST, I am using Alamofire
let decoded = try NSJSONSerialization.JSONObjectWithData(jsonData!, options: .MutableContainers) as? [String: AnyObject]
but the decoded constant always remains in nil
Thanks