我试图在自定义表格视图单元格上放置一个带有图像的自定义 UIButton 以将其用作复选标记,第一次点击,隐藏复选标记,下一次点击将其带回来......我正在尝试下面的代码“示例代码”来执行这个功能,但它没有隐藏复选标记,即“自定义 UIButton”。不知道我在这里错过了什么?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"%@",indexPath);
TableViewCell *customCell = [[TableViewCell alloc]init];
if (customCell.checkMarkButton.hidden == NO) {
customCell.checkMarkButton.hidden = YES;
} else {
customCell.checkMarkButton.hidden = NO;
}
}