title: How to set different images for every cell in uiTableView.?
body: <p>I have tableView and i want to set the different image for every cell in my tableView based of certain condition but i am getting the image of last satisfied condition for all cells.</p>
  
  <p>here is my code:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
  
      }
  
      cell.textLabel.font = [UIFont boldSystemFontOfSize:14]; 
      cell.textLabel.numberOfLines = 2; 
  
  if (self.pickerSelectedRow == [self.datePickerArray objectAtIndex:1])
      {
          for (int i=0; i&lt;[appDelegate.serverResponseArray count]; i++)
          {
              if([[[appDelegate.serverResponseArray objectAtIndex:i]valueForKey:@"session_type" ] isEqual: @"workshop"])
              {
                  cell.imageView.image = [UIImage imageNamed:@"workshops.png"];
              }
              if([[[appDelegate.serverResponseArray objectAtIndex:i]valueForKey:@"session_type" ] isEqual: @"keynote"])
              {
                  cell.imageView.image = [UIImage imageNamed:@"keynote.png"];
              }
              if([[[appDelegate.serverResponseArray objectAtIndex:i]valueForKey:@"session_type" ] isEqual: @"panel"]|| [[[appDelegate.serverResponseArray objectAtIndex:i]valueForKey:@"session_topic" ] isEqual: @"WISNET"])
              {
                  cell.imageView.image = [UIImage imageNamed:@"pannel.png"];
              }
              if([[[appDelegate.serverResponseArray objectAtIndex:i]valueForKey:@"session_type" ] isEqual: @"social"] || [[[appDelegate.serverResponseArray objectAtIndex:i]valueForKey:@"session_topic" ] isEqual: @"RWW"])
              {
                  cell.imageView.image = [UIImage imageNamed:@"social.png"];
              }
  
  
          }
         cell.textLabel.text =  [[self.globalSessionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
      } 
  </code></pre>
  
  <p>Expected output:
  <img src="https://i.stack.imgur.com/QLs6d.png" alt="i am expecting output something like this (ignore the content of cells.)"></p>
  
  <p>output i am getting: </p>
  
  <p><img src="https://i.stack.imgur.com/wu9fI.png" alt="i am getting output something like this (ignore the content of cells.)"></p>