RestKit 0.20.1 Как отобразить родительский идентификатор

Учитывая эту полезную нагрузку XML:

<payload>
        <year yearNum="2013">
                <month monthNum="6" desc="This month was an enlightening month"/>
                <month monthNum="5" desc="This month was a questioning month"/>
                <month monthNum="4" desc="This month was a good month"/>
                <month monthNum="3" desc="This month was a crazy month"/>
                <month monthNum="2" desc="This month was a dry month"/>
                <month monthNum="1" desc="This month was a slow month"/>
        </year>
        <year yearNum="2012">
                <month monthNum="12" desc="This month was a cold month"/>
                <month monthNum="11" desc="This month was an expensive month"/>
                <month monthNum="10" desc="This month was a free month"/>
                <month monthNum="9" desc="This month was a hard month"/>
                <month monthNum="8" desc="This month was a surprising month"/>
                <month monthNum="7" desc="This month was an energetic month"/>
                <month monthNum="6" desc="This month was a hasty month"/>
                <month monthNum="5" desc="This month was a relaxing month"/>
                <month monthNum="4" desc="This month was a fair month"/>
                <month monthNum="3" desc="This month was a strange month"/>
                <month monthNum="2" desc="This month was a lucky month"/>
                <month monthNum="1" desc="This month was a odd month"/>
        </year>
</payload>

и отображение:

RKEntityMapping *monthlyReportMapping = 
    [RKEntityMapping mappingForEntityForName:@"MonthlyReport" 
           inManagedObjectStore:[[RKObjectManager sharedManager] managedObjectStore]];

monthlyReportMapping.identificationAttributes = @[@"yearNumber", @"monthNumber"]];
[monthlyReportMapping addAttributeMappingsFromDictionary:@{
        /* 
         * How would I set up the mappings for the yearNumber 
         * so I can use it as the composite identifier with 
         * the monthNumber? I want to do something like this:
         */
        @"@metadata.parent.yearNum" : @"yearNumber",
        @"monthNum" : @"monthNumber",
        @"desc" : @"description"
}];

RKResponseDescriptor *monthlyMappingResponseDescriptor = 
  [RKResponseDescriptor responseDescriptorWithMapping:monthlyReportMapping
                                          pathPattern:@"/monthlyReports"
                                              keyPath:@"payload.year.month" 
    statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];

[[RKObjectManager sharedManager] addResponseDescriptor:monthlyMappingResponseDescriptor];

Как бы вы получили доступ кyearNum изнутриmonthlyReportMapping когда я сопоставляю в keyPathpayload.year.month?

Пожалуйста, предположите, что я не контролирую ответ XML.

Спасибо джастин

Ответы на вопрос(1)

Ваш ответ на вопрос