给tableviewcell加“勾选”

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
UITableViewCell *oneCell=[tableView cellForRowAtIndexPath:indexPath];
    
    [oneCell 
setAccessoryType:oneCell.accessoryType==UITableViewCellAccessoryCheckmark?UITableViewCellAccessoryNone:UITableViewCellAccessoryCheckmark];
    
    [tableView 
deselectRowAtIndexPath:indexPath animated:YES];
}

posted @ 2014-03-14 11:31  曈曈7添  阅读(221)  评论(0编辑  收藏  举报