ios 如何对UITableView中的内容进行排序

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleNone;
}

//排序调整
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
    if (sourceIndexPath.row == destinationIndexPath.row) {
        return;
    }
}

//在编辑的时候不让cell向右移动
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
    return NO;
}

取消编辑

[_sortTableView setEditing:NO animated:YES];

 

 

posted on 2013-09-18 11:23  Hai_阔天空  阅读(733)  评论(0)    收藏  举报

导航