[
{
"_id": "557f27522afb79ce0112e6ab",
"endereco": {
"cep": "asdasd",
"numero": "asdasd"
},
"categories": [],
"name": "teste",
"hashtag": "teste"
}
]
返回nil沒有錯誤:NSJSONSerialization.JSONObjectWithData返回零
var json = NSJSONSerialization.JSONObjectWithData(data, options:NSJSONReadingOptions.AllowFragments, error: &erro) as? NSDictionary
順便說一句,'NSJSONReadingOptions.AllowFragments'是不必要的。你可以使用'nil'。 – Rob