5
나는 아래의 기본 메일 응용 프로그램과 같은 여러 행을 선택할 수 있도록하려면 설정되어있을 때있는 UITableViewCell을 선택할 수 없습니다 :가있는 TableView setEditing이
나는
를 호출하는 버튼라는 편집이 위 그림과 같이[self.myTableView setEditing:YES animated:YES]
편집 버튼을 성공적으로 메일 응용 프로그램과 같은 세포의 왼쪽에 동그라미를 보여줍니다. 그러나 실제로 행 중 하나를 선택하면 아무 일도 일어나지 않습니다. 빨간색 체크 표시가 예상대로 원에 표시되지 않습니다. 빨간색 체크 표시가 나타나지 않는 이유는 무엇입니까?
#pragma mark - UITableViewDataSource Methods
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];
}
cell.textLabel.text = @"hey";
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 3;
}
#pragma mark - UITableViewDelegate Methods
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return 3;
}
#pragma mark - Private Methods
- (IBAction)editButtonTapped:(id)sender {
if (self.myTableView.editing) {
[self.myTableView setEditing:NO animated:YES];
}
else {
[self.myTableView setEditing:YES animated:YES];
}
}
감사합니다! 이것은 그 것이다. 또한 테이블보기 (테이블보기 컨트롤러 제외)에서 IB에서 "편집 중 : 편집 중 단일 선택"으로 변경할 수 있습니다. – jrc