-1

I have this response from an API and trying to find ways to map this to an NSDictionary using a Mantle value transformer.

 {
   "baggage": {
    "BAG10": "3.5",
    "BAG15": "3.5",
    "BAG20": "3.5",
    "BAG30": "3.5",
    "BAG40": "3.5"
   }
}

Thanks in advance

melaka
  • 699
  • 7
  • 23

2 Answers2

-1

You can use NSJSONSerialization passing in the server response as NSData

NSMutableDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]
RunLoop
  • 20,288
  • 21
  • 96
  • 151
-1

By the looks of it, we don't need to write any transformers for this property. Mantle handles by itself.

melaka
  • 699
  • 7
  • 23