Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 当UITableView处于编辑模式时,可选的UITableView单元格_Objective C_Ios_Uitableview - Fatal编程技术网

Objective c 当UITableView处于编辑模式时,可选的UITableView单元格

Objective c 当UITableView处于编辑模式时,可选的UITableView单元格,objective-c,ios,uitableview,Objective C,Ios,Uitableview,标题说明了一切。当UITableView处于编辑模式时,我需要选择UITableViewCells。我认为这里不需要代码,但如果需要: -(void)turnEditingOn { [self.tableView setEditing:YES animated:YES]; if (self.tableView.isEditing) self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBa

标题说明了一切。当UITableView处于编辑模式时,我需要选择
UITableViewCells
。我认为这里不需要代码,但如果需要:

-(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
}
因此,我需要能够在编辑模式下点击单元格,就像编辑闹钟时的时钟应用程序一样

多谢各位

编辑

忘了提一下:

-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

在编辑模式下未被调用

- (void)viewDidLoad {
  [super viewDidLoad];
  self.tableView.allowsSelectionDuringEditing = YES;
}
- (void)viewDidLoad {
  [super viewDidLoad];
  self.tableView.allowsSelectionDuringEditing = YES;
}