title: Cannot get NSURLConnection, but app keeps waiting
body: <p>So i have an app that connects to an internal IP Address. So i want to implement code that will make sure the NSSURLConnections is made (i.e. connected to the wireless network) because i wont be able to connect to the server if i am not on the wireless network. The problem is before i can check it goes and gets stuck. I implemented </p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
  </code></pre>
  
  <p>but it never gets called. Any ideas on how to proceed?</p>
  
  <p>this is my code to create the connection</p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:@"http://192.168.192.4/file.php"];
  NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
  NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  </code></pre>
  
  <p>after this last line, it goes off in the wild blue yonder!</p>
  
  <p><em><strong></em>**</strong><em>UPDATE</em><strong><em>*</em>**</strong></p>
  
  <p>this is the method that is called when a button is pressed.</p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:@"http://192.168.192.4/file.php"];
  NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
  
  connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  
  [request release];
  [connection release];
  </code></pre>
  
  <p>i also implemented these methods:</p>
  
  <p>didFailWithError:(NSError *)</p>
  
  <p>didFinishLoading</p>
  
  <p>didRecieveData</p>
  
  <p>I just changed the connection to (nonatomic, retain) ...there was no autocomplete option for strong. any pointers?</p>