Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c UITableView:重新排序期间块单元拖动_Objective C_Iphone_Uitableview - Fatal编程技术网

Objective c UITableView:重新排序期间块单元拖动

Objective c UITableView:重新排序期间块单元拖动,objective-c,iphone,uitableview,Objective C,Iphone,Uitableview,我对UITableView有问题。当我处于编辑模式时,我想对单元格重新排序,但当我拖动屏幕底部的单元格时,它可以下降到与TableView高度相同的高度,并下降到最后一个TableView单元格。我只有4个单元格,我希望当我拖动一个单元格时,它不允许在第四个单元格之后下降 有人能帮我吗 嘿,我知道这是一篇老文章,但我遇到了这个问题,下面是我从UITableViewDelegate中找到的这个方法。您可以通过执行以下操作来阻止您的手机: - (NSIndexPath *)tableView:(UI

我对UITableView有问题。当我处于编辑模式时,我想对单元格重新排序,但当我拖动屏幕底部的单元格时,它可以下降到与TableView高度相同的高度,并下降到最后一个TableView单元格。我只有4个单元格,我希望当我拖动一个单元格时,它不允许在第四个单元格之后下降


有人能帮我吗

嘿,我知道这是一篇老文章,但我遇到了这个问题,下面是我从UITableViewDelegate中找到的这个方法。您可以通过执行以下操作来阻止您的手机:

- (NSIndexPath *)tableView:(UITableView *)tableView 
       targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath 
       toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath {

    if (sourceIndexPath == [NSIndexPath indexPathForRow: YOUR_ROW_NUMBER inSection: YOUR_SECTION_NUMBER])
        return sourceIndexPath;
    else
        return proposedDestinationIndexPath;
}
希望这对别人有帮助

干杯