title: Xcode: iPhone Freezes when calling a "sendSynchronousRequest"
body: <p>I have an issue and don't know how to fix it,<br>
  In my app i have a UIWebView that loads pdf's starting by "folder1/1.pdf"  </p>
  
  <p>the loading itself works just fine but if i call a function in my app that checks if i have a 2.pdf in the same folder, it just freezes, no errors no nothing.</p>
  
  <p>the function i call is:</p>
  
  <pre><code>- (void)isValidURL
  {
  
      int i = 1;
      NSString *folder = @"folder1";
      NSURL *url = [NSURL URLWithString:[baseUrl stringByAppendingFormat:@" %@/%d.pdf",folder,i]];
      NSURLRequest *req = [NSURLRequest requestWithURL:url];
      NSHTTPURLResponse *res = nil;
      NSError *err = nil;
      [NSURLConnection sendSynchronousRequest:req returningResponse:&amp;res error:&amp;err];
  }  
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>
  
  <p>THANKS!!</p>