title: Delegate functions not being called
body: <p>Long time lurker, first time poster.</p>
  
  <p>I'm making a ServerConnection module to make it a whole lot modular and easier but am having trouble getting the delegate called.  I've seen a few more questions like this but none of the answers fixed my problem.</p>
  
  <p>ServerConnection is set up as a protocol. So a ServerConnection object is created in Login.m which makes the call to the server and then add delegate methods in Login to handle if there's an error or if it's done, these are called by ServerConnection like below.</p>
  
  <pre><code>- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
  
      if( [self.delegate respondsToSelector:@selector(connectionDidFinish:)]) {
          NSLog(@"DOES RESPOND");
          [self.delegate connectionDidFinish:self];
      } else {
          NSLog(@"DOES NOT RESPOND");
      }
  
      self.connection = nil;
      self.receivedData = nil; 
  
  }
  </code></pre>
  
  <p>It always "does not respond".  I've tried the CFRunLoop trick (below) but it still doesn't work.</p>
  
  <pre><code>- (IBAction)processLogin:(id)sender {
  
      // Hide the keyboard
      [sender resignFirstResponder];
  
      // Start new thread
      NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  
      // Acutally call the server
      [self authenticate];
  
      // Prevent the thread from exploding before we've got the data
      CFRunLoopRun();
  
      // End thread
      [pool release];
  
  }
  </code></pre>
  
  <p>I copied the <a href="http://developer.apple.com/iphone/library/samplecode/URLCache/Introduction/Intro.html" rel="nofollow noreferrer">Apple URLCache demo</a> pretty heavily and have compared them both many times but can't find any discrepancies.  </p>
  
  <p>Any help would be greatly appreciated.</p>