ios - RestKit how to map an array inside an array -


here's response:

{   "status": true,   "statuscode": 200,   "result": [     {       "name": "abc",       "date": "2015-01-30",       "documents": [         {           "id": 1,           "name": "doc1",           "status": "complete",         },         {           "id": 2,           "name": "doc2",           "status": "complete",         },         {           "id": 3,           "name": "doc3",           "status": "complete",         }       ],       "message": "hello world",       "status": 3     }   ] } 

i want map , "document" inside array keyed "result" , don't need other objects / mappings. need documents. how can done / declared in response descriptors automatically match these documents managed object?

try :-

nsdictionary *dic=@{                     @"status": @true,                     @"statuscode":@ 200,                     @"result": @[                             @{                                 @"name": @"abc",                                 @"date": @"2015-01-30",                                 @"documents": @[                                         @{                                             @"id":@ 1,                                             @"name": @"doc1",                                             @"status": @"complete",                                             },                                         @{                                             @"id":@ 2,                                             @"name": @"doc2",                                             @"status":@ "complete",                                             },                                         @{                                             @"id":@ 3,                                             @"name": @"doc3",                                             @"status": @"complete",                                             }                                         ],                                 @"message": @"hello world",                                 @"status":@ 3                                 }                             ]                     }; 

i storing response in nsdictionary , -

 [[[dic objectforkey:@"result"] objectatindex:0] objectforkey:@"documents"] 

change indexnumber require !


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -