0
이 테이블은 오른쪽 상단에 "편집"이있는 데이터베이스에 연결되어 있습니다. 스 와이프를 삭제할 수 있지만 수정 버튼을 누르면 아무 일도 일어나지 않습니다! 내 말은, 동일한 프로그램에서 다른 테이블에 대한 비슷한 호출을 작성했는데 편집을 누르면 작은 "잠금 해제"가 나타납니다. 그렇다면 그것을 누를 경우 요소/행을 삭제할 수 있습니다 ... 여기에 없습니다!편집 할 때 "삭제 잠금 해제"Subview
- (void)viewDidLoad
{
self.title = @"Categorie";
[super viewDidLoad];
self.navigationItem.rightBarButtonItem = self.editButtonItem;
[self.navigationItem setHidesBackButton:YES animated:YES];
[tableView reloadData];
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
- (void)tableView:(UITableView *)_tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
// A lot of code...
}
}
확인 : (BOOL)
다음이 샘플 액션 메소드의 애니메이션 . 이제 작동합니다. 하지만 ii는 편집 모드에있을 때 "편집"대신 "완료"를 표시하지 않습니다. – Oiproks
다른 '완료'barButton이 있어야 편집 버튼으로 전환 할 수 있습니다. 코드를 업데이트하겠습니다. – toddbranch
완벽! 주문서에 코드를 쓰고보기에 입력 할 때 "완료"버튼이 있지만 두 줄의 전환을 해결했습니다. 도와 주셔서 정말로 고맙습니다. – Oiproks