如何使用路径模式将响应映射设置为管理器..如果路径处的 getobjects 与用于映射响应的路径模式不同。
[manager addResponseDescriptorsFromArray:
@[[RKResponseDescriptor responseDescriptorWithMapping:categoryMapping
pathPattern:A
keyPath:nil
statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]]];
[manager getObjectsAtPath:A/ID
parameters:nil
success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
NSLog(@" Category success");
[self.delegate didReceiveAssignedCategories];
}
failure:^(RKObjectRequestOperation *operation, NSError *error) {
NSLog(@"Category failure");
}];
响应映射路径 ie:A 必须设置为用于 getobject ie:A/ID 的动态路径。前任:
呼叫 1)
A = /getAllCategories
A/ID = /getAllCategories/123
呼叫 2)
A = /getAllCategories
A/ID = /getAllCategories/456
响应映射对于 123、456 相同,仅在获取我使用不同 url 的对象时,即:附加了 id。怎么做 ?