Can I disable the UITableView selection of the individual cell?
cell.selectionStyle = UITableViewCellSelectionStyleNone;
or [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
Further, make sure you either don't implement -tableView:didSelectRowAtIndexPath:
in your table view delegate
or explicitly exclude the cells you want to have no action if you do implement it.
Implement tableView:willSelectRowAtIndexPath:
delegate method of UITableView
and return nil
.Returning nil from this method tells the table view to not select the row consequently tableView:didSelectRowAtIndexPath:
method will not get called.But doing this does not prevent highlighting the row.To disable highlighting effect on row set cell selection style toUITableViewCellSelectionStyleNone
as explained in the above answers.
Just set :
cell.selectionStyle = UITableViewCellSelectionStyleNone;