How to specify child objects type in an NSArray with Mantle

后端 未结 5 1681
無奈伤痛
無奈伤痛 2021-01-31 17:30

If I have a dictionary like

{
  name: \"Bob\",
  cars: [
    { make: \"ford\", year: \"1972\" },
    { make: \"mazda\", year: \"2000\" }
  ],
}

5条回答
  •  忘了有多久
    2021-01-31 18:16

    A note on:

    [NSValueTransformer mtl_JSONArrayTransformerWithModelClass:CarModel.class];
    

    This methods seems to now be deprecated. I'm using this new method in my code and it appears to be working just fine:

    [MTLJSONAdapter arrayTransformerWithModelClass:CarModel.class];
    

提交回复
热议问题