mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-11-19 10:31:23 +00:00
25 lines
584 B
Objective-C
25 lines
584 B
Objective-C
#import "NSOutlineView-SelectedItems.h"
|
|
|
|
/* The methods in the following catagory were based upon those in OmniAppKit */
|
|
|
|
@implementation NSOutlineView (ResKnifeSelectedItemExtensions)
|
|
|
|
- (id)selectedItem
|
|
{
|
|
if( [self numberOfSelectedRows] != 1 ) return nil;
|
|
else return [self itemAtRow:[self selectedRow]];
|
|
}
|
|
|
|
- (NSArray *)selectedItems;
|
|
{
|
|
NSNumber *row;
|
|
NSMutableArray *items = [NSMutableArray array];
|
|
NSEnumerator *enumerator = [self selectedRowEnumerator];
|
|
|
|
while( row = [enumerator nextObject] )
|
|
[items addObject:[self itemAtRow:[row intValue]]];
|
|
|
|
return items;
|
|
}
|
|
|
|
@end |