#pragma mark - Edit-(BOOL)tableView:(UITableView*)tableViewcanEditRowAtIndexPath:(NSIndexPath*)indexPath{returnYES;}-(UITableViewCellEditingStyle)tableView:(UITableView*)tableVieweditingStyleForRowAtIndexPath:(NSIndexPath*)indexPath{returnindexPath.section?UITableViewCellEditingStyleInsert:UITableViewCellEditingStyleDelete;}-(void)tableView:(UITableView*)tableViewcommitEditingStyle:(UITableViewCellEditingStyle)editingStyleforRowAtIndexPath:(NSIndexPath*)indexPath{switch(editingStyle){caseUITableViewCellEditingStyleDelete:{NSString*item=self.selectCategoies[indexPath.row];[self.selectCategoiesremoveObject:item];[tableViewdeleteRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationFade];[self.unselectCategoiesinsertObject:itematIndex:0];[tableViewinsertRowsAtIndexPaths:@[[NSIndexPathindexPathForRow:0inSection:1]]withRowAnimation:UITableViewRowAnimationFade];break;}caseUITableViewCellEditingStyleInsert:{NSString*item=self.unselectCategoies[indexPath.row];[self.unselectCategoiesremoveObject:item];[tableViewdeleteRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationFade];[self.selectCategoiesaddObject:item];[tableViewinsertRowsAtIndexPaths:@[[NSIndexPathindexPathForRow:self.selectCategoies.count-1inSection:0]]withRowAnimation:UITableViewRowAnimationFade];break;}caseUITableViewCellEditingStyleNone:break;}[selfuploadCategorySetting];}-(NSString*)tableView:(UITableView*)tableViewtitleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath*)indexPath{return@"删除";}#pragma mark - Move-(BOOL)tableView:(UITableView*)tableViewcanMoveRowAtIndexPath:(NSIndexPath*)indexPath{if(indexPath.section==0){returnYES;}else{returnNO;}}-(void)tableView:(UITableView*)tableViewmoveRowAtIndexPath:(NSIndexPath*)sourceIndexPathtoIndexPath:(NSIndexPath*)destinationIndexPath{[self.selectCategoiesexchangeObjectAtIndex:sourceIndexPath.rowwithObjectAtIndex:destinationIndexPath.row];[tableViewexchangeSubviewAtIndex:sourceIndexPath.rowwithSubviewAtIndex:destinationIndexPath.row];[selfuploadCategorySetting];}