One Quickie


Filter a table view selection (UITableView->General)
You might have some rows in a UITableView you don't want to be selected. Override willSelectRowAtIndexPath, return nil to reject the selection, return the passed-in indexPath to use as-is, or return your choice of selected cells.
- (NSIndexPath *) tableView: (UITableView *) tableView
   willSelectRowAtIndexPath: (NSIndexPath *) indexPath {
    // don't select the top row sort control.
    if (indexPath.row == 0) return nil;
    else return indexPath;
} // willSelectRowAtIndexPath



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

webmonster@borkware.com