0
我試圖映射以下對象:將沒有root密鑰的對象映射到動態url?
{"walletAccepted":false,"creditCardTypesAccepted":["visa","mastercard","discover","americanexpress"],"paypalAccepted":false}
要具有相同屬性的對象。但是,ResourcePath是動態的,因爲它沿着/ paymentmethods/zone /行:internalZoneCode
我在映射時所做的每一次嘗試總是以「映射期間遇到的錯誤:無法找到對象映射對於keyPath:''「
我認爲問題是沒有root密鑰/密鑰路徑。我也嘗試沒有運氣以下:
RKURL *rkUrl = [RKURL URLWithBaseURL:[RKClient sharedClient].baseURL resourcePath:[NSString stringWithFormat:@"/paymentoptions/zone/%@", zoneNumber]];
RKObjectLoader* loader = [[RKObjectLoader alloc] initWithURL:rkUrl mappingProvider:[RKObjectManager sharedManager].mappingProvider];
loader.method = RKRequestMethodGET;
loader.delegate = self;
loader.objectMapping = [[RKObjectManager sharedManager].mappingProvider objectMappingForClass:[PMZonePaymentMethods class]];
[loader send];