Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的情节提要上有一个 TableViewController 有一些单元格(静态),我想在点击单元格时添加复选标记,我如何能够从情节提要中调用各个单元格而无需在代码中构建它们?
在您的表视图的委托中:
- (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)ip { MyCustomCell *cell = [tv cellForRowAtIndexPath:ip]; // add the checkmark to the cell [cell.contentView addSubview:checkmarkIcon]; }