Map JSON response that has brackets with RESTKit
pI'm doing a GET request with RESTKit, and I need sone help mapping the
JSON response. Here is the response that I need to map:/p
precode{limit_hit:false,providers: [{id:876553, name:Cooper, Bradley N,
DDS, specialty_groups:[Other Provider], tags:[], has_comments:false,
number_of_comments:0, locations: [{address:1234 Rifle Range Road, El
Cerrito, CA, 94530, providers_at_address_count:1, client_product_count:0,
non_client_product_count:2, address_lines:[1234 Rifle Range Road, El
Cerrito, CA, 94530], address_id:234578, specialty_groups:
[{specialty_group:Other Provider}], provider_types: [{provider_type:Other
Provider}]}, {address:7501 Mission Rd, Shawnee Mission, KS, 66208,
providers_at_address_count:2, client_product_count:0,
non_client_product_count:2, address_lines:[7654 Main S, El Cerrito, CA,
94530], address_id:654432, specialty_groups: [{specialty_group:Other
Provider}], provider_types: [{provider_type:Other Provider}] }] }] }
/code/pre pI want to be able to map both addresses, but I don't know how.
All I'm able to do currently is map the id, name, has_comments, and
number_of_comments (I'm using the keypath of providers). Here is my
current mapping provider:/p precode+ (RKMapping *)searchMapping {
RKObjectMapping *mapping = [RKObjectMapping
mappingForClass:[ProviderSearch class]]; [mapping
addAttributeMappingsFromDictionary:@{ @id: @doctorID, @name: @name, }];
return mapping; } /code/pre pWhat exactly am I doing wrong, and how do I
fix it?/p
No comments:
Post a Comment