开始向下滚动时复选标记消失的方式。
下面是该didSelectRowAtIndexPath
方法的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
if (selectedCell.accessoryType == UITableViewCellAccessoryCheckmark) {
selectedCell.accessoryType = UITableViewCellAccessoryNone;
if ([[[collectionDataArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"creditHours"]==@"1") {
totalHoure = totalHoure - 1;
}
} else {
selectedCell.accessoryType = UITableViewCellAccessoryCheckmark;
if ([[[collectionDataArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"creditHours"]==@"1") {
totalHoure = totalHoure + 1 ;
}
}
}
有什么问题吗 ?或者如果有任何其他技术。