您的位置:首页 > 移动开发 > IOS开发

ios cell多选

2016-03-13 21:24 190 查看
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath
{

NSArray *value = [selectValueDictionaryallKeys];
if ([valuecontainsObject:inv.uuid])
{
cell.accessoryType =UITableViewCellAccessoryCheckmark;

}else
{
cell.accessoryType =UITableViewCellAccessoryNone;

}

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

UITableViewCell *cell = [self.tableView
cellForRowAtIndexPath: indexPath ];

if (cell.accessoryType ==UITableViewCellAccessoryNone){
cell.accessoryType =UITableViewCellAccessoryCheckmark;
[selectValueDictionary
setObject:indexPath forKey:[jobWelfareArrayobjectAtIndex:indexPath.row]];

}
else{
[selectValueDictionaryremoveObjectForKey:[jobWelfareArrayobjectAtIndex:indexPath.row]];
cell.accessoryType =UITableViewCellAccessoryNone;
}

[self.tableViewdeselectRowAtIndexPath:indexPathanimated:YES];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: