0
嘿家伙我在我的tableview上有两个部分,我有一个只更新一个部分的可变数组。我想将数组中的单元格移动到空白部分。我试图为空白部分创建另一个数组,但我无法使其工作。这是我的moveRowAtIndexPath方法。将行移动到不同的部分
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
id objectToMove = [myArray1 objectAtIndex:fromIndexPath.row];
id objectToMove2 = [myArray2 objectAtIndex:fromIndexPath.row];
//move objects between main section
[myArray1 removeObjectAtIndex:fromIndexPath.row];
[myArray1 insertObject:objectToMove atIndex:toIndexPath.row];
//move object from main section to blank section
[myArray1 removeObjectAtIndex:fromIndexPath.row];
[myArray2 insertObject:objectToMove atIndex:toIndexPath.row];
我有我的numberOfRowsInSection返回适当的数组计数为每个部分,但仍然没有运气。当我进入编辑模式时,我尝试移动单元格消失。