- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UISwitch *shoutDown= [[UISwitch
alloc]init];
[shoutDown addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
// return cell;
}
- (void)switchAction:(id)sender{
//获取点击按钮对应的cell
UISwitch *switchInCell = (UISwitch *)sender;
//UISwitch的superview就是cell
UITableViewCell * cell = (UITableViewCell*) switchInCell.superview;
NSIndexPath * indexpath = [self.tableView indexPathForCell:cell];
}