3
标题说明了一切。当UITableView处于编辑模式时,我需要选择UITableViewCells
。我不认为代码在这里是必需的,但如果它是:当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)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
没有得到所谓的编辑模式