I want to cancel all requests. This is how I create an asynchronous connection:
[NSURLConnection sendAsynchronousRequest:echo queue:self.queue completionHandler:^(NSURLResponse *respone, NSData *data, NSError *error){
Then I use this method:
-(void)cancelAllRequests
{
NSLog(@"%@",self.queue.operations);
[self.queue cancelAllOperations];
[self.queue waitUntilAllOperationsAreFinished];
}
to cancel all requests.
Which actually does nothing but change BOOL to YES.
So how should I cancel the asynchronous connection?
source
share