0
我想通過下面的代碼映射POST響應,但是當達到didLoadObjects時Restkit試圖映射相同的對象,因爲我試圖POST(發佈Foo並希望它映射Bar ,但RestKit試圖將返回映射到Foo)。Restkit映射POST迴應
[self.objectManager sendObject:mySyncInstance toResourcePath:url usingBlock:^(RKObjectLoader* postLoader) {
postLoader.delegate = aDelegate;
postLoader.objectMapping = [self.objectManager.mappingProvider objectMappingForClass:[Bar class]];
postLoader.method = RKRequestMethodPOST;
postLoader.userData = kUserDefaultsAttendanceReads;
postLoader.serializationMIMEType = RKMIMETypeJSON;
postLoader.serializationMapping
[postLoader setUsername:[prefs objectForKey:kCurrentUsername]];
[postLoader setPassword:[prefs objectForKey:kCurrentPassword]];
}];// end sendObject