How to Stop a Synchronous NSURLRequest in iPhone?
<p>I used synchronous request to fetch data from server and insert those data in the database.This is working perfectly alright.Now the problem is that I want to stop the request in between the process is going on (means when the request is already send for data  or during when the data are inserting in the database).So Is there any way that we can stop the Synchronous request forcefully.What is the best way to do that?Please suggest...
Below is the code for that</p>

<pre><code>NSURL *url = [NSURL URLWithString:soapMessage];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];

[theRequest addValue: @"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[theRequest setHTTPMethod:@"GET"];

NSData *theData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse: nil error:nil];


NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData: theData];
[xmlParser setDelegate: self];
[xmlParser setShouldResolveExternalEntities: YES];
[xmlParser parse];
[xmlParser release];
</code></pre>

<p>and after that performed simple insert operation.</p>
