2012-05-16 2 views
-1

삭제하려는 UITableView의 항목 목록이 있습니다. iPhone에서 삭제 메시지와 유사한 삭제 기능을 재사용 할 수있는 방법이 있습니까?iOS 삭제 메시지와 유사한 기능 삭제

+0

의 코드 주위에 포장하기 이미 많은 질문이 있습니다. http://stackoverflow.com/questions/9471642/swipe-to-delete-tableview-row 메시지 기능을 삭제 –

+0

아이폰이 슬쩍되지 않습니다 : [1] 가 [1] [여기를 참조] 지우는 것 – Firdous

답변

4

당신은 같은 UITableViewDelegate 방법의 일부 구현해야합니다 :

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 

편집의 기본 기능을 제공하고 세포를 삭제하면, 당신은 탐색 모음에서 편집 버튼을 포함하는 라가 필요합니다을 :

[[self navigationItem] setLeftBarButtonItem:[self editButtonItem]]; 

이 일부 개정에 당신이 찾고있는 "기본"구현의 대부분을 수용해야 물론 :)이