0
誰かがこの状況に遭遇しましたか?行を並べ替えると、最後の行のソースインデックスパスが '0'に設定されています
セルを最下部から最上部まで順番に並べ替えると、クラッシュすることがあります。これらのクラッシュは、iSourceIndexPath.rowが0になったときに発生します。私はいつもピッキングしている最後の行であるため、iSourceIndexPath.rowが0になっているのだろうかと思います。どんな手掛かり?
- (NSIndexPath *)tableView:(UITableView *)iTableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)iSourceIndexPath toProposedIndexPath:(NSIndexPath *)iProposedDestinationIndexPath {
NSIndexPath *aReturnIndexPath = iProposedDestinationIndexPath;
if(iProposedDestinationIndexPath.row == 0) {
aReturnIndexPath = iSourceIndexPath;
}
NSLog(@"iProposedDestinationIndexPath=%d iSourceIndexPath=%d aReturnIndexPath=%d",iProposedDestinationIndexPath.row,iSourceIndexPath.row,aReturnIndexPath.row);
return aReturnIndexPath;
}
クラッシュは何を言いますか?例外情報を表示する – aryaxt
テーブルをリロードする必要がありますか? - (void)tableView:(UITableView *)iTableView moveRowAtIndexPath:(NSIndexPath *)iFromIndexPath toIndexPath:(NSIndexPath *)iToIndexPath? – Abhinav