[
{
"_id": "557f27522afb79ce0112e6ab",
"endereco": {
"cep": "asdasd",
"numero": "asdasd"
},
"categories": [],
"name": "teste",
"hashtag": "teste"
}
]
不带错误返回nil:
var json = NSJSONSerialization.JSONObjectWithData(data, options:NSJSONReadingOptions.AllowFragments, error: &erro) as? NSDictionary
NSJSONReadingOptions.AllowFragments
是不必要的。你可以直接使用nil
。 - Rob