- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:nil];
    
    // 设置cell右边指示器的类型
    if (indexPath.row % 2 == 0) {
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    
    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
    cell.accessoryView = [[UISwitch alloc] init];
    
    // 设置背景(背景view不用设置尺寸, backgroundView的优先级 > backgroundColor)
    UIImageView *bgView = [[UIImageView alloc] init];
    bgView.image = [UIImage imageNamed:@"buttondelete"];
//    bgView.backgroundColor = [UIColor redColor];
    cell.backgroundView = bgView;
    
    UIView *selectedbgView = [[UIView alloc] init];
    selectedbgView.backgroundColor = [UIColor greenColor];
    cell.selectedBackgroundView = selectedbgView;
    return cell;
}