好吧,我在编辑过程中使用多项选择并同时滑动以删除功能..我想要的是当单击选择按钮时,将其标题更改为取消并将颜色设为红色..
而发生在我身上的是标题仍然保留为edit
and done
。我究竟做错了什么?
-(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;
}