title: ios custom Uitableview cell with xib
body: <p>I want to display N number of button on single cell of tableview.
  for that i have created xib of one button and i want to load that xib N number of times into my tableview cell.</p>
  
  <p>I use following code but it just display xib one time in every row.
  I have used for loop and scrollview to have multiple view of xib one single row but it only display one time.</p>
  
  <p><strong><em>Update</em></strong>  :- I change my table vie code as suggested in answer. but my scrollview is not working horizontally and i got extra xib view at starting of every row. 
  I think this is beacuse of  <code>[self.table registerNib:[UINib nibWithNibName:@"wagon" bundle:nil] forCellReuseIdentifier:@"Cell"];</code> in view did load..how can i solve this problem? </p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
  
   static NSString *CellIdentifier = @"Cell";
  
  
  
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
  
    if (cell==nil) {
  
      }
  
  
    cellScrollViewClass  * scrollView  = [[cellScrollViewClass alloc]   initWithFrame:CGRectMake(MyPadding,14,myWidth-MyPadding*2,200)]; // Scrollview
    scrollView.scrollEnabled=YES;
    scrollView.userInteractionEnabled=YES;
    scrollView.showsHorizontalScrollIndicator=NO;
    scrollView.contentSize = CGSizeMake((336*NumberofCell),187); // To make ContentSize for item to scroll
  for (int i = 0; i &lt; NumberofCell; i++)
  { // for loop to add 2 wagon view and 1 engine view on Left hand side Custom cell.
  
      UIView *nib = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
      UIView *wagonView = [[UIView alloc]initWithFrame:CGRectMake((385*i)-200, 18, 385, 163)];
      [wagonView addSubview:nib];
      [scrollView addSubview:wagonView];
  }
  cell.accessoryView=scrollView;
  
    return cell;
     }
  </code></pre>
  
  <p>In view did load i register nib</p>
  
  <pre><code>[[self table]setDelegate:self];
  [[self table]setDataSource:self];
  [self.view addSubview:table];
  [table setShowsHorizontalScrollIndicator:NO];
  [table setShowsVerticalScrollIndicator:NO];
  table.separatorColor = [UIColor clearColor];
  [table setContentInset:UIEdgeInsetsMake(-15,0,0,0)];
  [self.table registerNib:[UINib nibWithNibName:@"wagon" bundle:nil] forCellReuseIdentifier:@"Cell"];
  </code></pre>