Please write this code in cellForRowAtIndexPath:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
If you add check box and uncheck box then write this code in cellForRowAtIndexPath
if(indexPath.row == 0){
UIButton *btnForCheckAC = [[UIButton alloc]initWithFrame:CGRectMake(cell.frame.size.width - 50 , 10,15,15)];
btnForCheckAC.tag = BUSTYPEBTN_TAG;
UIImage *image = (isAcButtonClkd)?[UIImage imageNamed:@"check-mark-pink.png"]:[UIImage imageNamed:@"uncheckbox.png"];
[btnForCheckAC addTarget:self action:@selector(busTypebtnAction:event:) forControlEvents:UIControlEventTouchUpInside];
[btnForCheckAC setImage:image forState:UIControlStateNormal];
cell.accessoryView = btnForCheckAC;
}
Then in didSelectedRowAtIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) {
isAcButtonClkd = !isAcButtonClkd;
}
}
Write the button action:
-(void)busTypebtnAction:(id *)sender event:(id)event{
NSSet *touches = [event allTouches];
UITouch *touch = [touches anyObject];
CGPoint currentTouchPosition = [touch locationInView:self.tblBookBus];
NSIndexPath *indexPath = [self.tblBookBus indexPathForRowAtPoint: currentTouchPosition];
if (indexPath != nil)
{
[self tableView: self.tblBookBus didSelectRowAtIndexPath: indexPath];
}
}
Change the name according to your requirement.
I hope it will help to you.