테이블 뷰에 커스터마이징된 셀이 붙어 있을때,
셀을 밀어서 삭제하기 위한 방법을 찾고 있다
정상 작동하는 타 프로그램에서 찾은 방법
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
NSString *pSeq = [[pDataBase.recordListArray objectAtIndex:indexPath.row]objectForKey:@"SEQ"];
// 레코드 삭제
[pDataBase deleteRecordData:pSeq];
[pDataBase.recordListArray removeObjectAtIndex:indexPath.row];
[pListView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:(UITableViewRowAnimationFade)];
}
'IT > iPhone' 카테고리의 다른 글
ios에서 2차원배열 값 replaceObjectAtIndex 사용하여 수정하기 (0) | 2016.05.06 |
---|---|
ios에서 PickerView를 사용하여, 시간을 선택하기 (0) | 2016.05.04 |
ios에서 PickerView 를 사용하기 위한 준비단계 (0) | 2016.04.29 |
[ios앱만들기-사진편집] 카메라 기능 추가하기 (0) | 2016.04.22 |
setNeedsDisplay 와 DrawRect (0) | 2016.04.16 |