Q:

Adding buttons to a UITableView cell

I am trying to add buttons to my UITableView cells, using code like below:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];

    UIButton *button = self.buttons[0];
    [cell addSubview:button];

    return cell;
}

The button isn't showing though. Is it possible to add buttons to a cell like this or do I have to make a custom UITableViewCell class?
When the button was made for the array the frame was set like below:
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 70, 70)]

A:

The usage for adding elements have changed somewhen. Use
[cell.contentView addSubview:button];

and don't forget to proof before if a button is already added :P
enum
{
    kButtonForA = 3333 // example
};

for every button set
button.tag = kButtonForA;

and use them
UIButton* btn = (UIButton *)[cell.contentView viewWithTag:kButtonForA];
if(!button)
    btn = self.buttons[i];

UPDATE
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    if(!self.buttons || [self.buttons count] == 0)
        return 0;
    return ...;
}

and after you init your array, use 
[tableView reloadData];

just one possible way, but a fast one

