The untouchable, how? If you want the cell not to be selected, you are probably looking for this:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
If you want your code to not execute when the selection is turned off, just check the selection property inside your didSelectRowAtIndexPath: method. Something like that:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell.selectionStyle != UITableViewCellSelectionStyleNone) {
Remember that you still have to play with this property by setting to UITableViewCellSelectionStyleNone when you do not want the cell to be selected, and returning to UITableViewCellSelectionStyleBlue (or UITableViewCellSelectionStyleGray ) when you want it to be selectable again.
source share