有没有人遇到过这种情况?
当我从最底部到最顶部重新排序单元格时,我会崩溃。这些崩溃发生在 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;
}