Created
July 17, 2012 17:47
-
-
Save kevinejohn/3130793 to your computer and use it in GitHub Desktop.
Restkit Post object with RootKeyPath and return object without RootKeyPath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RKObjectMapping* merchantSignupMapping = [RKObjectMapping mappingForClass:[WLMerchantSignup class]]; | |
[merchantSignupMapping mapKeyPathsToAttributes: | |
nil]; | |
[paymentProcessorObjectManager.mappingProvider addObjectMapping:merchantSignupMapping]; | |
//[paymentProcessorObjectManager.mappingProvider setMapping:merchantSignupMapping forKeyPath:@""]; | |
[paymentProcessorObjectManager.mappingProvider setSerializationMapping:[merchantSignupMapping inverseMapping] forClass:[WLMerchantSignup class]]; | |
[paymentProcessorObjectManager.router routeClass:[WLMerchantSignup class] toResourcePath:SERVER_WLMERCHANTSIGNUP]; | |
//[paymentProcessorObjectManager.mappingProvider registerObjectMapping:merchantSignupMapping withRootKeyPath:@"merchant"]; | |
[[RKObjectManager sharedManager] postObject:merchant usingBlock:^(RKObjectLoader * loader) { | |
loader.objectMapping = [appdelegate.paymentProcessorObjectManager.mappingProvider objectMappingForClass:[WLMerchantSignup class]]; | |
//loader.targetObject = nil; | |
[loader.serializationMapping setRootKeyPath:@"merchant"]; | |
loader.delegate = self; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment