我想重新排序我的tableview中的行。我已经实施了这两种方法。TableView setEditing也使行删除
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath{
NSLog(@"Move Row At IndexPath");
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"Can Move Row At IndexPath");
if(indexPath.section == 0 || (indexPath.section == 1 && indexPath.row == 0)){
NSLog(@"Don't Move");
return NO;
}
return YES;
}
现在我只是要重新排序的细胞,不希望用户删除的细胞。但是,当我启用编辑[tableView setEditing:yes animated:YES];
,那么它也让用户从表视图中删除项目,我只想显示表视图中的重新排序控制,如iphone设置 - >通知中心,然后按编辑。
有些人可以有一个想法如何做到这一点。
感谢
你不需要第3种方法来实现移动行...这些方法仅用于插入和删除。 – NKB