ios 关于UITableView UITableViewCellAccessoryCheckmark 混乱的(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-01 14:19 点击:次
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {//table单击事件
UITableViewCell *cell = [tableView cellForRowAtIndexPath: indexPath];
NSString *str=cell.textLabel.text;
NSDictionary *dict=[self getOneDictByName:str];
if([self isExistsByName:str theArray:selectedData]){
[self removeOneFromArrayByName:str theArray:selectedData];
}else{
[selectedData addObject:dict];
}
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
代码中的selectedData是一个NSMutableArray。
然后在cellForRowAtIndexPath方法里限定cell的accessoryType值。
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- iPhone开发 文件的增加删除查询
- iOS文件存磁盘的设想
- iphone-使用TextField及关闭键盘(useing TextField for in
- iPhone开发 调用阿asp.net程序的webservice
- Cocoa Core Competencies 的Object creation 和IOS面试题示例
- ios 关于UITableView UITableViewCellAccessoryCheckmark 混乱的
- iphone开发基础三和c语言混编
- 深入理解iPhone静态库(手把手教你iphone开发
- (iOS-iap防护)验证用户付费收据,拒绝iap
- ios 时间定时器 NSTimer应用demo
新闻点评
新闻关注排行榜
热门推荐
最新推荐