Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ipaps

macrumors newbie
Original poster
Aug 16, 2010
1
0
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
NSURL *url = [NSURL URLWithString:soapMessage];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];

[theRequest addValue: @"application/x-www-form-urlencoded" forHTTPHeaderField:mad:"Content-Type"];
[theRequest setHTTPMethod:mad:"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];

and after that performed simple insert operation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.