the api request returns something like this:
[
{
"macAddress":"x:x:x:x",
"hatInfo":{
"hatHierarchyString":"hello",
"floorRefId":"xxx",
.....
I am using swiftyJSON to parse this, I got data from Alamofire request:
let json = JSON(data)
let mapHeir = json[0]["hatInfo"]["hatHierarchyString"]
print(mapHeir)
This returns null, I tried:
let mapHeir = json[0]["hatInfo"]["hatHierarchyString"].string
let mapHeir = json[0]["hatInfo"]["hatHierarchyString"].stringValue
let mapHeir = json["hatInfo"]["hatHierarchyString"]
and all of them return empty. How can I get to hatHierarchyString?
Aucun commentaire:
Enregistrer un commentaire