2012-12-19 60 views
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:編輯動畫:是];編輯點擊,但如果我把它didselectrowowatindexpath不叫請請幫助無法調用didSelectRowAtIndexPath按下編輯按鈕後

+0

坦率地說,我不明白你的問題。請重新說明它。 –

回答

0

您需要設置您的tableview的allowedSelectionDuringEditing屬性爲YES。

_tableView.myTableView.allowsSelectionDuringEditing = YES;