Objective c 当UITableView处于编辑模式时,可选的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
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;
}