0
移動行之後,我更改了與單元格關聯的biz的行號和引號。如果cellForRowAtIndexpath被再次調用,那麼事情就會起作用。如何在移動行之後再次調用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是明智的。但是,我想更新左側的號碼。儘管撥打
self.table reloadData
,但仍不會撥打cellForRowAtindexpath
。