Hi I’m trying to have my uitableviewcell rendered inactive so that a user can’t click but merely say the data in the cell. I attempt to do so with:
UITableViewCell *cell = nil;
if (indexPath.row < factsCount) {
static NSString *FactsCellIdentifier = @"FactsCell";
cell = [tableView dequeueReusableCellWithIdentifier:FactsCellIdentifier];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
However the cell can still be clicked and highlighted.
Thanks for your help!
To stop just some cells being selected use:
As well as preventing selection, this also stops tableView:didSelectRowAtIndexPath: being called for the cells that have it set.
(but note that it will disable any interactive content within the cells – eg. buttons – for that case, set selectionStyle to UITableViewCellSelectionStyleNone and ignore the tableView:didSelectRowAtIndexPath: call for that cell)