I am able to get all the required RKObjectLoaderDelegate methods called when doing a GET with loadObjectsAtResourcePath:delegate:.
However, when I am doing a POST with post:params:delegate:, only request:didLoadResponse: gets called. Even methods such as objectLoader:didLoadObjects: and objectLoader:didFailWithError: are not getting called.
Here is the code snippet.
self.appObjectManager.client = [RKObjectManager managerWithBaseURLString:self.webServiceURLString];
[self.appObjectManager.client setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[self.appObjectManager.client setValue:@"" forHTTPHeaderField:@"Cookie"];
RKObjectMapping* sessionInformationMapping = [RKObjectMapping mappingForClass:[sessionInformation class]];
[sessionInformationMapping mapKeyPath:@"uid" toAttribute:@"userID"];
[self.appObjectManager.mappingProvider setObjectMapping:sessionInformationMapping forKeyPath:@"user"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"abc", @"pwd", nil]
forKeys:[NSArray arrayWithObjects:@"username", @"password", nil]];
[self.appObjectManager.client post:resourcePath params:parameters delegate:self];
I found a similar question here, but it doesn’t seem to help me.
RestKit: What delegate method is called for postObject?
Try this instead of post:params:delegate:
The objectLoader delegate methods should get called when the response returns.