One Quickie


Responding to selection changes (NSTableView->General)
- (void) tableViewSelectionDidChange: (NSNotification *) notification
{
    int row;
    row = [tableView selectedRow];

    if (row == -1) {
        do stuff for the no-rows-selected case
    } else {
        do stuff for the selected row
    }

} // tableViewSelectionDidChange
If you have more than one tableview, the notification's object is the tableview that had the selection change.



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

webmonster@borkware.com