title: how to use custom cell in objective-c
body: <p>I want to create 4 cell "button or picture" in one row in uiTableView like this picture:</p>
  
  <p>but I don't know how can I do that :</p>
  
  <p>would you please help me!
  Thanks in advance!</p>
  
  <p>here is my code :</p>
  
  <pre><code>- (void)viewDidLoad
  {
  [super viewDidLoad];
  NSMutableArray *keys = [[NSMutableArray alloc] init];
  NSMutableDictionary *contents = [[NSMutableDictionary alloc] init];
  
  NSString *monKey = @"Monday";
  NSString *tueKey = @"Tuesday";
  NSString *wedKey = @"Wednday";
  NSString *thuKey = @"Thusday";
  NSString *friKey = @"Friday";
  NSString *satKey = @"Satuarday";
  NSString *sunKey = @"Sunnday";
  
  [contents setObject:[NSArray arrayWithObjects:@"Work Time", @"Absence", nil] forKey:monKey];
  [contents setObject:[NSArray arrayWithObjects:@"Compensation", @"Work Time", @"Absence", nil] forKey:wedKey];
  [contents setObject:[NSArray arrayWithObjects:@"Compensation", @"Work Time", nil] forKey:tueKey];
  [contents setObject:[NSArray arrayWithObjects:@"Compensation", @"Work Time", nil] forKey:thuKey];
  [contents setObject:[NSArray arrayWithObjects:@"Compensation", @"Work Time", nil] forKey:friKey];
  [contents setObject:[NSArray arrayWithObjects:@"Compensation", @"Work Time", nil] forKey:satKey];
  [contents setObject:[NSArray arrayWithObjects:@"Compensation", @"Work Time", nil] forKey:sunKey];
  
  [keys addObject:tueKey];
  [keys addObject:monKey];
  [keys addObject:wedKey];
  [keys addObject:thuKey];
  [keys addObject:friKey];
  [keys addObject:satKey];
  [keys addObject:sunKey];
  
  
  
  [self setSectionKeys:keys];
  [self setSectionContents:contents];
  
  
  self.navigationItem.leftBarButtonItem = self.editButtonItem;
  UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd  
  target:self action:@selector(addNewItem)];
  self.navigationItem.rightBarButtonItem = rightButton;
  }
  
  
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
  NSString *key = [[self sectionKeys] objectAtIndex:[indexPath section]];
  NSArray *contents = [[self sectionContents] objectForKey:key];
  NSString *contentForThisRow = [contents objectAtIndex:[indexPath row]];
  
  static NSString *CellIdentifier = @"CellIdentifier";
  
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil)
  {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
  reuseIdentifier:CellIdentifier];
  }
  
  [[cell textLabel] setText:contentForThisRow];    
  int column = 4;
  for (int i=0; i&lt;column; i++) {
  
      UIImageView *aBackgroundImageView = [[UIImageView alloc]initWithFrame:CGRectMake(32+184*i,10, 167,215)];
      aBackgroundImageView.tag = (column*indexPath.row)+i;
      [cell.contentView addSubview:aBackgroundImageView];
   //   [aBackgroundImageView release];
  }
  return cell;
  
  }
  
  - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
  
  if(section == 0)
      return @"Monday";
  else if(section == 1){
      return @"Tuesday";
  }else if(section == 2){
      return @"Wednesday";
  } else if(section == 3){
      return @"Thuesday";
  } else if(section == 4){
      return @"Friday";
  } else if(section == 5){
      return @"Saturday";
  }else
      return @"Sunday";
  
  }
  </code></pre>
  
  <p><strong>Edit 1</strong> </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] initWithFrame:CGRectZero]; 
  }
  cell.selectionStyle = UITableViewCellSelectionStyleNone;
  
  int column = 4;
  for (int i=0; i&lt;column; i++) {
  
  UIImageView *aBackgroundImageView = [[UIImageView alloc]initWithFrame:CGRectMake(32+184*i,10, 167,215)];
  aBackgroundImageView.tag = (column*indexPath.row)+i;
  [cell.contentView addSubview:aBackgroundImageView];
  
  }
    return cell;
  }
  </code></pre>