2009-10-26 2 views
0

터치를 추적하기 위해 추가 편집 컨트롤 (흰색 원과 함께 녹색 동그라미)을 가져 오는 방법이 있습니까? 예를 들어 연락처 프로그램을 사용하면 추가 작업을 수행하기 위해 셀 자체 또는 왼쪽의 원을 만질 수 있습니다. 불행히도 tableViewCell을 편집 할 때 동일한 동작을하지 않습니다. tableViewCell 자체에 대한 터치 만 추적되며 추가 녹색 원을 만지는 것은 아무 것도하지 않습니다.터치를 추적하기 위해 uitableviewcell에서 추가 편집 컨트롤을 얻는 방법

이러한 추가 편집 컨트롤에서 터치를 추적 할 수있는 방법이 있습니까?

감사

답변

1

당신이있는 UITableViewController에 commitEditingStyle을 구현 했습니까?

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 
    if (editingStyle == UITableViewCellEditingStyleDelete) { 
     // Delete the row from the data source 
    } 
    else if (editingStyle == UITableViewCellEditingStyleInsert) { 
     // Add a new row to the data source  
    } 
} 
+0

정말 고마워요. Apple의 "Recipe"예제 코드는이 방법을 구현하지 않았습니다. 다음에 Apple의 샘플 코드를 완전히 신뢰한다는 사실을 더 잘 알고 있습니다. –

관련 문제