#import "NSTableViewExtensions.h"


@implementation NSTableView (Extensions)

    - (int) numberOfSelectedRows; {
        id e = [self selectedRowEnumerator];
        int i = 0;
        while ([e nextObject]) { i++; }
        return i;
    }
    
    - (int) firstSelectedRow; {
        id o, e = [self selectedRowEnumerator];
        int i = 0;
        int first = 0, current;
        while ((o = [e nextObject])) {
            current = [o intValue];
            if (i == 0 || current < first) {
                first = current;
            }
            i++;
        }
        return first;
    }

@end