iphone - What methods do I have to implement in order to re-arrange the UITableView rows? -


called lines, do I use a NSMutableArray of string to apply to move your table controller For example, tableView rows and changes are reflected in my array?

Here's where we do our work.

  - (void) tableView: (UITableView *) tableView moveRowAtIndexPath: (NSIndexPath *) fromIndexPath toIndexPath: (NSIndexPath *) toIndexPath {NSLog (@ "The move% for d:% D ", indexpath.ro, to indexpath.ro); // bringing goods in line to be taken NSString * r = [lines objectAtIndex: fromIndexPath.row]; // Remove the original from the data structure [Delete the objects objectAut Index: fromIndexPath.row]; // Insert objects in the target line [rows insertObject: r atIndex: toIndexPath.row]; NSLog (@ "result of move: \ n% @", [self lines]); .}  

Since this is a basic example, lets make all rows moveable

  - (bool) tableView: (UITableView *) tableView canMoveRowAtIndexPath :( NSINXAP *) IndexPath {Return Yes; }  

Comments