我正在尝试通过下面的代码映射 POST 响应,但是当到达 didLoadObjects 时,Restkit 正在尝试映射与我尝试 POST 相同的对象(发布 Foo 并希望它映射 Bar,但 RestKit 正在尝试映射返回 Foo)。
[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