title: problem with connecting the server and downloading the data
body: <p>i am trying to download the data from the server for that i wrote code with in the action method but it is not at all help full.can any one tell me the exact way to connect and download the data from the server.</p>
  
  <pre><code>-(IBAction)download {    
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *documentsDirectory = [paths objectAtIndex:0]; 
  NSString *path = [documentsDirectory stringByAppendingPathComponent:@"books"]; 
  
  NSURL *downloadUrl = [NSURL URLWithString:@"url contains   .zip file"];
  NSData *data = [NSData dataWithContentsOfURL:downloadUrl];
  NSLog(@"%@",data);
  
  [data writeToFile:path atomically:YES];
  NSLog(@"final line");
  
  NSLog(@"%@",data);
  
  NSData *newdata=[NSData dataWithContentsOfFile:path];
  
  NSLog(@"the new data %@",newdata);*/
  
  }
  </code></pre>