나는 UIPanGuestureRecognizer이 코드를 사용하여 전체 뷰에 추가 한 : 나는에 슬쩍을 사용하려면이 코드가 jQuery과이 기본보기 내에서출근 UIPanGestureRecognizer
UIPanGestureRecognizer *pgr = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)];
[[self view] addGestureRecognizer:pgr];
을
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"RUNNING2");
return UITableViewCellEditingStyleDelete;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row >= _firstEditableCell && _firstEditableCell != -1)
NSLog(@"RUNNING1");
return YES;
else
return NO;
}
만 RUNNING1
이 로그에 인쇄 및 삭제 버튼이 표시되지 않습니다 : 기능을 삭제합니다. 나는이 이유가 UIPanGestureRecognizer라고 믿지만 확실치 않습니다. 이것이 올바른 경우 어떻게 수정해야합니까? 이것이 올바르지 않으면 원인을 제시하고 수정하십시오. 감사. document에서
당신은 테이블 뷰의 대표로 클래스를 설정 했습니까? – rdelmar
@rdelmar 예. 또한 RUNNING1이 인쇄되지 않을 것이라고 생각하지 않습니다. 하지만 노력해 줘서 고마워. – carloabelli
canEditRorAtIndexPath : 대리자 메서드가 아닌 데이터 소스 메서드이므로 대리자를 설정하지 않은 경우 실행됩니다. – rdelmar