title: How to download file using NSURL Connection
body: <p>I know its stupid to ask but i dont know where i am wrong. I am new to NSURLConnections. I have to download a file using NSURLConnection. here is my code:</p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:@"http://www.comicbookresources.com/feed.php?feed=previews"];
  
  NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];
  NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:request delegate:self startImmediately:YES ];
  [self.data appendData:self.data];
  NSString  *filePath = [NSString stringWithFormat:@"%u/%@", NSDocumentDirectory,@"usman.pdf"];
  [self.data writeToFile:filePath atomically:YES];
  </code></pre>
  
  <p>it looks ridiculous but still i am asking </p>
  
  <p>EDIT: I am sorry. I forgot to add word: asynchronous connection</p>