views:

49

answers:

1

I am attempting to create a table view whose cells can be reordered (using the tableView:moveRowAtIndexPath:toIndexPath table view data source delegate method). What I have written works fine in the simulator (in OS 3.0) but not on the device (iPod touch with OS 3.0). The drag controls are visible on both the simulator and device, and the above-mentioned method fires on both the simulator and device. Using NSLogs, I can see that, on the iPod, the to row and from row are always the same. It seems that I can "select" the row by touching the drag control, but the control is released as soon as I begin to "drag" up or down. Any one have any ideas on why this would be? Thanks!

-(void)tableView:(UITableView *)theTableView moveRowAtIndexPath:(NSIndexPath *)fromPath toIndexPath:(NSIndexPath *)toPath
{   
    NSLog(@"into move method... from:%d  to:%d", [fromPath row], [toPath row]);
    // Make adjustments to the favoritesArray.
    NSMutableDictionary *temp = [[favoritesManager favoritesArray] objectAtIndex:[fromPath row]];
    [temp retain];
    [[favoritesManager favoritesArray] removeObjectAtIndex:[fromPath row]];
    [[favoritesManager favoritesArray] insertObject:temp atIndex:[toPath row]];
    [temp release];
}
A: 

I'm having the exact problem! Did you find any solution to this?

jr
Sort of... I eventually put that portion of the code on hold and moved on to other things. However, when I was later testing my application, I realized that the reordering was suddently working even though I had not changed that portion of the code. I don't know exactly what caused it to start working, but I suspect that it was upgrading beyond OS 3.0 (maybe when I moved to 3.1?)...
J.R. Armstrong
Aha! That solved the problem! I tested the code in 3.1 and it's working! Thanks you!
jr