tags:

views:

35

answers:

1

UIButton * button; I have put cell.accessoryView = button;

In didSelectRowAtIndexPath i have written above code,but it doesn't show UIButton on cell of UITabelView

+2  A: 

You need to put this in the delegate method -tableView:cellForRowAtIndexPath: that initializes and returns cells for the table view:

- (UITableViewCell *) tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // initialize cell and contents here, for the specified indexPath value
}

You might want to read the Table View Programming Guide for iPhone OS, which explains this in detail.

Alex Reynolds