Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- ...
- ...
- [cell.cellSwitch addTarget:self action:@selector(switchUD:) forControlEvents:UIControlEventValueChanged];
- [cell.cellSwitch setTag:indexPath.row];
- ...
- ...
- return cell
- }
- -(void)switchUD:(id)sender {
- NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[sender tag] inSection:0];
- NSArray* rowsToReload = [NSArray arrayWithObjects:indexPath, nil];
- [self.tableView reloadRowsAtIndexPaths:rowsToReload withRowAnimation:UITableViewRowAnimationAutomatic];
- }
Advertisement
Add Comment
Please, Sign In to add comment