I know the question has been asked a lot. but i haven't found an answer. Whenever my api returns anything other than statuscode 200 i get this error. It looks like it fails in ASIHTTPRequest. I am using afnetworking 1.3.2.
0x1001facd4: b 0x1001fac8c ; failWithError + 1608 at NRMAASISupport.m:265 Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key HTTPMethod.' *** First throw call stack: (0x187e1a59c 0x19852c0e4 0x187e1a220 0x188cb80f4 0x188c050f0 0x1001fa834 0x1000faf00 0x1000fbbe8 0x1000f193c 0x187d72ebc 0x187d7fcc0 0x187d729d4 0x18781e560 0x187d72ebc 0x187d72dd8 0x187dd29ec 0x187dd1c90 0x187dcfd40 0x187cfd0a4 0x187d4f1fc 0x10010578c 0x188cedc0c 0x198d4fe80 0x198d4fddc 0x198d4cfb0) libc++abi.dylib: terminating with uncaught exception of type NSException
-(void)loginWithUser:(NSString*)user andPassword:(NSString*)password defaultCompany:(NSString*)companyId andDelegate:(id)delegate{
NSString *URLString = [NSString stringWithFormat:@"%@/login/", self.baseURL];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:URLString]];
NSString *postString = [NSString stringWithFormat:@"<Login xmlns='http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities'><DefaultCompanyId>%@</DefaultCompanyId><Email>%@</Email><Password>%@</Password></Login>", companyId, user, password];
NSMutableData *data = [[postString dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];
[request appendPostData:data];
NSLog(@"postString: %@", postString);
request.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:@"login", @"type", delegate, @"delegate", password, @"password", companyId, @"companyId", nil];
[request addRequestHeader:@"Content-Type" value:@"application/xml"];
request.delegate = self;
[request setDidFinishSelector:@selector(loginFinished:)];
[request startAsynchronous];
}
This call returns 401 Unauthorized and then the app crashes. If it returns 200 everything works.
After trying something new, i get an exception here. "CFRunLoopRun();" in ASIHTTPRequest
while (runAlways) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CFRunLoopRun();
[pool release];
}