1
과 같이 호출되지 않았습니다. loadObjectsAtResourcePath : delegate :를 사용하여 GET을 수행 할 때 호출되는 모든 필수 RKObjectLoaderDelegate 메서드를 가져올 수 있습니다.RKObjectLoaderDelegate 메서드가 post : params : delegate :
그러나 post : params : delegate :가있는 POST를 수행 할 때만 요청 : didLoadResponse :가 호출됩니다. objectLoader : didLoadObjects : 및 objectLoader : didFailWithError와 같은 메소드도 호출되지 않습니다.
다음은 코드 단편입니다.
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];
여기에도 비슷한 질문이 있지만 도움이되지 않습니다. PARAMS : RestKit: What delegate method is called for postObject?
Worked. 감사. – OutOnAWeekend