title: Objective-C iOS callback function between classes
body: <p>I'm new to iPhone application development, but I seem to have somewhat managed so far (learning as I go).. however, I've run in to an issue I can't figure out. Here's the scenario:</p>
  
  <p>I have an extension class called CoreAPI which I have my network functions inside. I have a function called "Login" inside CoreAPI which makes a request to a server, gets the 0 or 1 response and returns true or false. I had this working perfectly with Synchronous requests, but now I need to make everything asynchronous.</p>
  
  <p>So, below is what I'm trying to do.. this is not working with the error along the lines of "Object of type ID has no method loginCallback"</p>
  
  <p><strong>loginViewController.m</strong></p>
  
  <pre><code>- (void) login {
      CoreAPI APIObject = [[CoreAPI alloc] init];
      [APIObject login:self];
  }
  
  - (void) loginCallback {
      NSLog(@"It called back.");
  }
  </code></pre>
  
  <p><strong>CoreAPI.m</strong></p>
  
  <pre><code>- (void)login:(id)sender {
      [sender loginCallback];
  }
  </code></pre>
  
  <p>Thanks, and please let me know if I have missed any details needed to help me.</p>