1
我有一个UITableView从SQL数据库读取数据。iOS重新排序UITableView
当我重新安排它只会改变顶部和底部的人
从顶部拖动1至底部
当我让他只去5它将数据切换顶部和底部的。
我用下面
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
[myStringsArray exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row];
}
我怎样才能重新排序列表?所以这将是2,3,4,5,1而不是5,2,3,4,1
作品非常完美,非常感谢 – user1838169 2013-05-14 12:41:02
我们非常欢迎并随时提供任何帮助 – 2013-05-14 12:41:44
我试图编辑答案,但由于编辑太短而被拒绝!这是编辑。上面的最后一行应该是: [myStringsArray insertObject:buffer atIndex:toIndexPath.row]; – mts 2013-05-29 01:54:42