I have been using ASIHTTPRequest for an application but it gives me error in topSecretFetchFailed method 5 out of 10 request, Not sure how to deal with it, Isn’t ASIHTTPRequest stable enough?
[request setDidFailSelector:@selector(topSecretFetchFailed:)];
EDIT:
This is my code or method which get called in each request. MARKET_INDEXES_URL its static string which has “someurl.com”;
- (void)requestData {
ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:[NSURLURLWithString:MARKET_INDEXES_URL]];
[req setDelegate:self];
[req setDidFailSelector:@selector(topSecretFetchFailed:)];
[req setDidFinishSelector:@selector(topSecretFetchComplete:)];
[self setRequest:req];
[self.request startAsynchronous];
}
and this is the fail handler
- (void)topSecretFetchFailed:(ASIHTTPRequest *)theRequest {
[[NSNotificationCenter defaultCenter] postNotificationName:@"MarketIndexesError" object:nil];
UIAlertView *view = [[UIAlertView alloc] initWithTitle:@"Warning !" message:@"Connection error, Please try again" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[view show];
[view release];
NSLog(@"MarketIndex service Fail: %d %@", [theRequest responseStatusCode], [theRequest responseStatusMessage]);
}
What you need is some reporting of the response details. Without that, you’re diagnosing in the dark. Put this in your failure handler: