Hello,
I'm using the ASIHTTPRequest library to request some data from a server in my iPhone app. But i cannot figure out how to create a timeout so that if the server goes down or the iPhone doesnt have internet connection the app doesnt crash.
Thanks in advance
EDIT>>>
tt.Kilew your code doesnt work... I posted a bit of sample code
NSURL *url = [NSURL URLWithString:@"A URL WITH A FORM"];
ASIFormDataRequest *requestPOST = [ASIFormDataRequest requestWithURL:url];
[requestPOST setPostValue:un forKey:@"username"];
[requestPOST setPostValue:pw forKey:@"password"];
[requestPOST setPostValue:@"Login" forKey:@"submit"];
[requestPOST start];
[requestPOST setTimeOutSeconds:10];
NSLog(@"Fail: %@", [requestPOST failWithError:ASIRequestTimedOutError]);