Possible Duplicate:
NSURLConnection timeout?
I have this code:
NSURL *url = [NSURL URLWithString:@"http://some-url-that-has-to-work/"];
NSURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSHTTPURLResponse *response = nil;
[NSURLConnection sendSynchronousRequest:request
returningResponse:&response error:NULL];
return (response != nil);
Is there a way to add a timeout so if the request takes more then 1 minute it just times out?