当UITableView处于编辑模式时,可选择UITableViewCells

Nov*_*arg 3 objective-c uitableview ios

标题说明了一切.UITableViewCells当UITableView处于编辑模式时,我需要选择可能的选项.我不认为这里的代码是必要的,但如果它是:

-(void)turnEditingOn {
  [self.tableView setEditing:YES animated:YES];
  if (self.tableView.isEditing)
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(newItem)];
  else
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(turnEditingOn)];
}

- (void)viewDidLoad
{
  [super viewDidLoad];
  self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(turnEditingOn)];
  //the rest of the code is omitted
}
Run Code Online (Sandbox Code Playgroud)

因此,我需要能够在编辑模式下对单元格进行点击,就像编辑警报时的Clock应用程序一样.

谢谢

编辑

忘了提一下:

-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
Run Code Online (Sandbox Code Playgroud)

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Run Code Online (Sandbox Code Playgroud)

没有在编辑模式中调用

Eug*_*ene 8

- (void)viewDidLoad {
  [super viewDidLoad];
  self.tableView.allowsSelectionDuringEditing = YES;
}
Run Code Online (Sandbox Code Playgroud)