One Quickie


Rearranging in UITableView (UITableView->General)
Implementing this method in your UITableView datasource will make the table draw the little rearrange marker on each row.
- (void) tableView: (UITableView *) tableView
moveRowAtIndexPath: (NSIndexPath *) from
       toIndexPath: (NSIndexPath *) to {
    // How to rearrange stuff if you're backed by an NSMutableArray:
    GRCue *cue = [_cues objectAtIndex: from.row];
    [cue retain];  // Let it survive being removed from the array.
    [_cues removeObjectAtIndex: from.row];
    [_cues insertObject: cue  atIndex: to.row];
    [cue release];

} // moveRowAtIndexPath



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com