保证tableview Checkmark的选中唯一性
来源:互联网 发布:21端口被占用 编辑:程序博客网 时间:2024/06/02 15:55
@property (nonatomic, strong) NSIndexPath *selectedIndexPath;
{
static NSString *CellIdentifier = @"YFCELLEDITDOCACADEMIC";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
//config the cell
cell.textLabel.text=[academicArray[indexPath.row]objectForKey:@"Typename"];
cell.tag=[[academicArray[indexPath.row]objectForKey:@"Typeid"]intValue];
if ([self.selectedIndexPath isEqual:indexPath])
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (self.selectedIndexPath) {
UITableViewCell *cell = [tableView cellForRowAtIndexPath:self.selectedIndexPath];
cell.accessoryType = UITableViewCellAccessoryNone;
}
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
self.selectedIndexPath = indexPath;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
0 0
- 保证tableview Checkmark的选中唯一性
- 保证文件名的唯一性
- 如何保证上线用户的唯一性
- 如何保证全局变量的唯一性?
- 如何保证全局变量的唯一性?
- 保证执行的进程唯一性
- HashSet保证元素唯一性的原理
- HashSet如何保证元素的唯一性
- IOS开发之TableView替换默认的checkmark为自定义图像
- TableViewCell 的CheckMark属性
- TreeSet保证元素唯一性
- HashSet保证元素唯一性
- HashSet集合是如何保证元素的唯一性的?
- HashSet集合是如何保证元素的唯一性的?
- Hashpmap的原理,HashMap怎样保证key的唯一性
- HashMap的原理,HashMap怎样保证key的唯一性
- TreeSet保证元素的 排序和唯一性 的原理
- Hashpmap的原理,HashMap怎样保证key的唯一性
- 南阳 358取石子(五)(斐波那契博弈)
- 循环链表
- 移植好lcd驱动和触摸屏驱动后,运行tslib库中的测试程序出现如下问题
- 发现一个Eclipse主题的网站
- HDU2444_The Accomodation of Students(二分图/最大匹配+判二分图)
- 保证tableview Checkmark的选中唯一性
- 实现算法2.17的程序
- 南阳 585 取石子(六)(尼姆博弈)
- python编码错误:UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position xxx ordinal not in
- linux信号量
- 一个数组中可根据需要生成若干个独立的链表
- JAVA设计模式——迭代器模式
- 南阳 161 取石子 (四)(威佐夫博弈)
- 内存管理初级