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)
没有在编辑模式中调用
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.allowsSelectionDuringEditing = YES;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
759 次 |
| 最近记录: |