title: urlConnection Delegate to handle multiple answer in the same class
body: <p>I have a ViewController.m file with 2 buttons that open a urlConnection, and I need to handle response.
  My problem is I don't understand in the delegate when a connection comes from button 1(abilita) or button2(login).
  what can I do?</p>
  
  <pre><code>-(IBAction)abilita {
  
      NSString *usernameEncoded = [username.text urlencode];
      NSString *passwordEncoded = [password.text urlencode];
      NSString *mittenteEncoded = [abilitaField.text urlencode];
      NSString *code=@"abcdef";
  
      NSString * address = [NSString stringWithFormat:@"http://www.xxx.net/smsweb/setsender/recsender.php?login=%25%40&amp;password=%25%40&amp;codice%@",usernameEncoded, passwordEncoded,code];
  
      NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:address]];
      urlConnectionRecsender=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
  }
  
  
  - (IBAction)login {
      NSString * address = [NSString stringWithFormat:@"http://www.xxx.net/smsscript/sendsms.php?login=%25%40&amp;password=%25%40&amp;tipo=2",usernameEncoded, passwordEncoded];
  
      NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:address]];
      urlConnectionLogin=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
  }
  
  //DELEGATE:
  
  - (void)connection:(NSURLConnection *)conn didReceiveResponse:(NSURLResponse *)response
  {
        mutableData = [NSMutableData data] ;
        if ([conn isEquals:urlConnectionRecsender]){
               // this is request urlConnectionRecsender
        }
        if ([conn isEquals:urlConnectionLogin]){
               // this is request urlConnectionLogin
        }
  }
  
  - (void)connectionDidFinishLoading:(NSURLConnection *)conn
  {
      NSMutableString *stringData = [[NSMutableString alloc] initWithData:mutableData encoding: NSASCIIStringEncoding];
  }
  </code></pre>
  
  <p>Can you write the code in the way I can understand in connectionDidFinishLoading what connection am I handling?</p>