title: handling response with NSURLConnection
body: <p>I have created an array of NSURLConnections, as I am running through a for loop and creating multiple NSURLConnections.</p>
  
  <p>Here is my code</p>
  
  <pre><code>for(int i = 0; i &lt;count; i++)
  {
  
   NSData *jsonData = [NSJSONSerialization dataWithJSONObject:finalJson options:NSJSONWritingPrettyPrinted error:&amp;error];
              if (!jsonData) {
                  NSLog(@"Error creating JSON object: %@", [error localizedDescription]);
              }
  
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"httpLink"]];
  
  
              [request setValue:@"application/json;charset=utf-8" forHTTPHeaderField:@"Content-Type"];
              [request setValue:APIKEY forHTTPHeaderField:@"X_API_KEY"];
  
              [request setHTTPMethod:@"POST"];
              [request setHTTPBody:jsonData];
  
              m_dataPush = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
  
              [m_dataPushArray addObject:m_dataPush];
  
              [m_dataPush start];
  
  
  }
  </code></pre>
  
  <p>Now as this a asynchronous task, the delegate functions will be called as below, I know how to handle one request , as below</p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  {
  
      if(connection == m_dataPush || connection == m_dataPull)
      {
          NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response;
          m_responseCode = [httpResponse statusCode];//Get status code for response
  
          m_ResponseData = [[NSMutableData alloc] init];
      }
  }
  
  - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
      // Append the new data to the instance variable you declared
  
  
      if(connection == m_dataPush || connection == m_dataPull)
      {
          [m_ResponseData appendData:data];
      }
  }
  
  
  - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
      // The request is complete and data has been received
      // You can parse the stuff in your instance variable now
  
  
      if(connection == m_dataPush || connection == m_dataPull )
      {
          NSDictionary *response = [NSJSONSerialization JSONObjectWithData: m_ResponseData options: 0 error: &amp;e];  //I am using sbjson to parse
  
      }   
  }
  </code></pre>
  
  <p>But I dont know how should I handle the array of NSURLConnections in this delegate methods</p>