views:

40

answers:

2

Hi there

Can you add a button as a subview to a uitableview cell and have that clickable, but not the cell itself. ie: I don't want the selected view to come up. Obvs I can just not have the cell disclose anywhere, but I don't want it to look "selected" when someone taps it.

Setting user interaction enabled to NO makes the whole thing unenabled, including the buttons.

Any ideas?

Thank you.

Tom

+1  A: 

implement this delegate method:

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}

and set the UITableViewCells selectionStyle property to UITableViewCellSelectionStyleNone

fluchtpunkt
thanks. :) and more characters...
Thomas Clayson
A: 
cell.selectionStyle = UITableViewCellSelectionStyleNone;

This will prevent the cell to highlight for a bit before the willSelect returns nil

Sander Backus