objective c - JSON Mapping any inner objects using Mantle -
if getting response this
{     "objects" : [           {               "a" : val1,               "b" : val2,           },           {               "a" : val1,               "b" : val2,           }      ] }   then how objects array in response?
the solutions have found follows:
1) can create model class objectsresponse representing above json , have nsarray property called objects. , can use
mtl_jsonarraytransformerwithmodelclass
to map json response objects property , access error using objectsresponse's object.
2) directly use method
[mtljsonadapter modelsofclass: [object fromjsonarray:[response objectforkey:@"objects"]]] error:&error]
is there direct way using mantle object mapping other these?
thanks
 
 
  
Comments
Post a Comment