iOSプロジェクトの場合、ユーザーが選択した行をドラッグして移動できるようにするのは比較的簡単です。のようなものだと思います
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (BOOL)tableView:(UITableView *)tableview canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
// ...
}
セルベースのテーブルがある場合、 Mac OSでNSTableView (iOS の UITableView ではない)をどのように使用しますか? ユーザーが項目をドラッグできるようにする Apple, Inc. のサンプル プロジェクトの 1 つがimage-browser です。NSTableView コントロールが含まれていないため、あまり役に立ちません。canDragRowsWithIndexes :atPointを使用していますか? canDragRowsWithIndexes で検索があまりヒットしません。「NSTableView 並べ替え」で検索すると、テーブル項目の並べ替えがヒットします。
アドバイスありがとうございます。