2012-07-29 2 views
2

글쎄 편집과 스 와이프 중에 동시에 여러 기능을 사용하고 있습니다 ... 원하는 기능은 선택 버튼을 클릭하고 제목을 변경하면됩니다. 취소하고 빨간색을 만드십시오.IOS 스 와이프로 삭제하고 여러 행을 편집하면 버튼 이름이 기본값으로 설정됩니다.

그리고 나에게 어떤 일이 일어나는지는 제목이 여전히 editdone 인 것으로 나타납니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

-(void)setEditing:(BOOL)editing animated:(BOOL)animated { 

    if (editing) { 
     self.tableView.allowsMultipleSelectionDuringEditing = YES; 
     self.editButtonItem.title = @"Cancel"; 
     self.editButtonItem.tintColor = [UIColor redColor]; 
    } else { 
     self.tableView.allowsMultipleSelectionDuringEditing = NO; 
     self.editButtonItem.title = @"Select"; 
     self.editButtonItem.tintColor = nil; 
    } 

    [super setEditing:editing animated:animated]; 
    self.tableView.allowsMultipleSelectionDuringEditing = editing; 

} 
+0

아무도 ?? 롤 .. 혼동해야합니다 – user1526474

+0

예, 통해 UR 질문은 충분히 명확하지 않다! "editButtonItem"이란 무엇입니까? – Nishant

답변

0

무엇이 넘어지고 있는지 잘 모르겠습니다. 귀하의 질문이 충분히 명확하지 않습니다. 여기서 찔러서이 위임 메서드를 사용하는 것이 좋습니다.

- (NSString *)tableView:(UITableView *)tableView 
    titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return @"New name for swipe button"; 
} 
관련 문제