title: How do I cancel a download with AFHTTPSessionManager?
body: <p>My app downloads information using a subclass of <code>AFHTTPSessionManager</code> and GET. The user may opt out of the download and I am trying to figure out how to cancel the download.</p>
  
  <p>I came across this code:</p>
  
  <pre><code>- (void) cancel {
      [self.operationQueue cancelAllOperations];
  }
  </code></pre>
  
  <p>But that didn't seem to work, since the download completed.</p>
  
  <p>I then tried:</p>
  
  <pre><code>- (void) cancel {
      for (NSURLSessionTask *task in self.tasks) {
          [task cancel];
      }
  }
  </code></pre>
  
  <p>This did seem to interrupt the download, but I am not sure if this is the proper way to do this. The docs are not very helpful for this (or I haven't found it yet).</p>
  
  <p>So, is the above the correct way to cancel my download? Do I need to do more cleanup?</p>