行を移動した後、セルに関連付けられているビジネスの lineandPin 番号を変更しました。cellForRowAtIndexpath が再度呼び出されると、うまくいくでしょう。
これは私のコードです
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
NSMutableArray * mutableBusinessBookmarked= self.businessesBookmarked.mutableCopy;
Business *bizToMove = mutableBusinessBookmarked[sourceIndexPath.row];
[mutableBusinessBookmarked removeObjectAtIndex:sourceIndexPath.row];
[mutableBusinessBookmarked insertObject:bizToMove atIndex:destinationIndexPath.row];
self.businessesBookmarked=mutableBusinessBookmarked;
[self rearrangePin];
[tableView moveRowAtIndexPath:sourceIndexPath toIndexPath:destinationIndexPath];
[self.table reloadData];
}
- 私はそれを正しく行っているかどうかわかりません。データモデルと呼び出しを更新しました
moveRowAtIndexPath
[tableView moveRowAtIndexPath...
何もしないようです。私がそれを呼び出すかどうかにかかわらず、行は移動されます。- self.table reloadData の呼び出しは賢明ではないと思います。ただし、左の数字を更新したい。
cellForRowAtindexpath
を呼び出してもまだ呼び出されませんself.table reloadData
。