Den*_*nov 2 objective-c uitableview ios
尝试重新排序行时遇到问题UITableView.我有tableView:moveRowAtIndexPath:toIndexPath:触发的功能,但是fromIndexPath等于toIndexPath(即source == destination).我在这里看到了同样的问题:uitableview重新排序不起作用,源始终等于目标
但是解决方案是 - 使用不同的库.这不是我的变种.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
//fromIndexPath is equal to toIndexPath, so nothing is exchaned
[self.table_data exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row];
}
Run Code Online (Sandbox Code Playgroud)
我的桌子处于可编辑模式,我已经 canMoveRowAtIndexPath:返回了YES.我没有用.怎么会?我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
1600 次 |
| 最近记录: |