1
IBOutlet _tableView;

-(IBAction)EditButton{

    NSLog(@"editButtonPressed");
    editing= !editing;
    [_tableView setEditing:editing animated:YES];
   }

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    tasklist *task=[items objectAtIndex:indexPath.row];
if(editing){
    TaskListEditorController *editor=[[TaskListEditorController alloc] initWithNibName:@"TaskListEditorController" bundle:nil];

    editor.defaulttext=task.prptext;

    editor.delegate=self;

    [self presentModalViewController:editor animated:YES];

    [editor release];

}else{


task.prpcompleted= !task.prpcompleted;

[tableView reloadData];

}
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

}

我正在尝试 xcode3.2.6 当我不放 [_tableView setEditing:editing animated:YES] 时我可以调用;在编辑点击,但如果我把它没有调用 didselectrowatindexpath 请帮助

4

1 回答 1

0

您需要将 tableview 的allowSelectionDuringEditing 属性设置为YES。

_tableView.myTableView.allowsSelectionDuringEditing = YES;

于 2012-12-19T10:47:22.417 回答