並べ替えられないテーブルビューがあります。moveRowAtIndexPath は、destinationIndexPath とは異なる sourceIndexPath で呼び出されることはないようです。列を引っ張ると、列が動きをサポートしていないかのように、開始位置に跳ね返ります。
すべての「canMove/canEdit/propose」メソッドを実装して YES を返そうとしましたが、同じ動作を観察しました。どうしたの?
- (void) tableView:(UITableView *)tableView
moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath
toIndexPath:(NSIndexPath *)destinationIndexPath {
NSLog(@"%d -> %d", [sourceIndexPath row], [destinationIndexPath row]);
if ([sourceIndexPath row] == [destinationIndexPath row]) {
return;
}
MyDomain *domain = [self getObject];
[domain.stuff exchangeObjectAtIndex:(NSUInteger) [sourceIndexPath row] withObjectAtIndex:(NSUInteger) [destinationIndexPath row]];
}