Не знаю, какое у вас приложение в твиттере, но вы можете создать собственную ячейку и добавить к ней две кнопки. Затем, когда создается экземпляр ячейки, вы можете указать селекторы и пользовательское фоновое изображение, если хотите.
@interface CustomCell : UITableViewCell {
UIButton* leftButton;
UIButton* rightButton;
}
@property(nonatomic, retain) IBOutlet UIButton* leftButton;
@property(nonatomic, retain) IBOutlet UIButton* rightButton;
@end
@implementation CustomCell
@synthesize leftButton, rightButton;
-(id) initWithFrame:(CGRect)frame reuseIdentifier:(NSString*)reuseIdentifier {
if( self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier] ) {
// init
}
return self;
}
-(void) setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// configure for selected
}
- (void)dealloc {
[rightButton release];
[leftButton release];
[super dealloc];
}
@end
// in root view controller:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CustomCellIdentifier";
// Dequeue or create a cell of the appropriate type.
CustomCell *cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray* nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
for( id oneObject in nib ) {
if( [oneObject isKindOfClass:[CustomCell class]] ) cell = (CustomCell*)oneObject;
}
}
NSInteger row = indexPath.row;
UIButton* tempButton = cell.leftButton;
tempButton.tag = row * 2;
[tempButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[tempButton setBackgroundImage:[thumbnails objectAtIndex:(row * 2)] forState:UIControlStateNormal];
tempButton = cell.rightButton;
tempButton.tag = (row * 2) + 1;
[tempButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[tempButton setBackgroundImage:[thumbnails objectAtIndex:((row * 2) + 1)] forState:UIControlStateNormal];
return cell;
}
Этот код немного старше, но он демонстрирует смысл.